Basics of server-side composition
A server-side composition implementing micro frontends requires a central point in the backend where the micro frontends are resolved and merged. The basic principle is shown in the next diagram:
In this pattern, teams will either go for full pages or just individual fragments. Fragments can be as large as fully composed parts of a page or as small as UI components with some domain logic.
The shown reverse proxy essentially plays the same role as the aggregation layer introduced in the previous chapter. The difference is that its responsibilities go beyond proxying micro frontends. Therefore, we'll usually refer to this point as a gateway service or a backend for frontend (BFF).
A BFF is a part of the backend that has been introduced only to serve the frontend. Generally, a BFF can be thought...