A gentle introduction.
We’ve seen significant benefits from choosing a microservice architecture for building enterprise applications, which allows us to structure teams based on business capabilities, improve scalability and enable the flexibility of being polyglot in the usage of technologies. Mostly this architecture is then complemented by a feature-rich and powerful browser application that sits on top of these backend-services. Unfortunately, the latter step ends up way too often in the creation of a single, sprawling and hard to maintain frontend-monolith. The approach of Micro Frontends is an effective way to tackle this problem.
As Micro Frontends are about bringing the advantages of microservices to the frontend world, we first need to understand what advantages we gain from this architectural style. Martin Fowlers phrases them as "independently deployable services" 1, Sam Newman as "Small and focused on one thing, to be autonomous"2. So autonomy and independence seem to be the main driver. But what are the advantages we gain from these properties?
I usually summarize the advantages of microservice architectures by following six points:
In many cases, this microservice architecture is being completed by adding a monolithical frontend on top of it. As a result, most of the benefits gained through microservices are lost on the Frontend side.
For all of the points I listed up earlier, a monolithic frontend is becoming our limiting bottleneck in the given microservice architecture. As shown in Figure 2 we are not able to do independent deployments anymore, as we can just redeploy the whole frontend at once. Besides this we are not really supporting distinct operations: The chances are high that our whole frontend is broken when one small part in it is not working properly. Up to now, we do not really support to be technology agnostic and modeling around business domains with a monolithic frontend turns out to be a contradiction that is difficult to overcome. But the last point, parallel development usually triggers the problem within companies and shows that there is an issue with their current frontend architecture, as we are usually not able to scale up the speed of development in a monolithic frontend.
Micro Frontends are one way to achieve the advantages we gain from modern microservice architectures also in the frontend world. We do so by splitting up our applications in full end-to-end verticals. We tend to call these Micro Frontends, Micro Apps or Verticalized Systems.
There are multiple ways to achieve this, and during this series of articles, we will guide you through the most prominent approaches. It is important to point out that Micro Frontends are not a silver bullet either. Rather, they are suited for a specific set of problems. In a nutshell, Micro Frontends can be a powerful tool to avoid frontend monoliths and this series will give you the needed knowledge to decide if it’s the right one for the job: We start the series with a pattern called Backends For Frontends, which turns out to be a perfect fit for systems following the Micro Frontend architectural style.
We are helping and consulting companies in the application of Micro Frontends since 2017. Thus we shared our knowledge at multiple conference meetups. One presentation from Devoxx Poland can be found here: