Micro Frontends: not a silver bullet
An imaginary story, where micro frontends failed
Gurgaon, India
Search for a command to run...
An imaginary story, where micro frontends failed
Gurgaon, India
Great article and good insights.
May I ask you how do you deal with store management in micro-frontend? Do you use Zustand? Recoil? Redux?
Do you have only one single store declared in the app shell or each micro-frontend has its own store?
Hi Simon. We were successfully able to do it with React context, and we kept the store centralized.
However, if you're keen on working with Redux, you can have a look at this. https://github.com/microsoft/redux-micro-frontend
Thanks for sharing 🙌
redux-micro-frontend library says that each Micro-Frontend is supposed to be a self-contained unit having its store. An individual application should not be able to modify the state of other apps, however, they should be able to see the state of other apps.
This is a great starting point!
Thanks for the insights
Awesome!! Thanks for sharing.
I'm not sure how much this matters in the era where generative AI writes code for you. However, still I embark upon this journey hoping this will help someone write better react code. Why you should organize your react components React itselft is uno...
Quantifying and reducing your web application's carbon emissions

Ultimate CDK deployment guide for Fargate. It works for any nodeJS Container too.

WARNING: Highly opinionated views against ionic and angular, opinions are mostly out of personal experience
Easy releasing beta versions of new features with your create-react-app based single page application just by changing the deployment directory
Micro frontends are a great feat of engineering. If you were able to move your 3 year old React repository to module-federation based micro frontends, it is indeed a great achievement.
However, I feel there are a few situations, where micro frontends are not a perfect fit. Here's a completely imaginary story of an application's evolution.
So, there's this team of front-end developers and they intend to rewrite their web application. Like all great react application, they too started to write their code with create-react-app boilerplate and redux.
Soon there were demands for more and more routes and journeys in their react application. The team size increased from 3 to 9, so they were divided into 3 teams. So, there are now 3 teams working on the same codebase, and the delivery challenges were slowly surfacing, challenges like
Project managers were soon fighting among themselves. Some wanted to own all the common parts, some didn't want to own any, and nobody understood the concept of sharing.
So the developers decided to break apart the monolithic frontend repository, and go into a micro front-end architecture. Here's how they split this up.

The lead developer was happy and almost immediately updated his CV mentioning this achievement.
With micro-frontend architecture they were able to solve:-
| Factor | Before | After |
| Release autonomy | Coupled Deliveries, therefore Risk of regression therefore more testing time | Almost decoupled deliveries, so less test time |
| Ownership Issues | Every developer had the visibility of the whole repository and its architecture | Every team was concerned about their own modules, and the common container and shared code was orphaned now. |
This too, however came with some cost.
| Factor | Before | After |
| Consistency | Coding pattern was consistent accross the teams | Each team defined their own ESLint rules as per their comfort level |
| Unit test benchmarks | Consistent accross the repo | Each team defined their own ESLint rules as per their comfort zone |
| Reusability | Maximum | Moderate |
| Upgrades | Upgrading dependencies had to be done in one place | All the modules need to be in the same version, so dependency upgrades are very costly now, and had to be planned. |
To address this challenges, the developers came together and proposed going into monorepo with lerna or nx, but the project managers immediately started fighting about the ownership of the repo, and the developers gave up.
So, in a way, micro-frontends are a great thing, with mono-repo, even better, but due to the ownership model, it seemed to be causing more issues now. Smart readers of this post have already started relating this with Conway's Law.
So, the developers, decided to split ways completely and now they had 3 react applications.

So, they lost a few great things, like
But there were benefits too.
The last point about evolution is very important in the field of software engineering. An application ecosystem soon becomes outdated if it does not allow experimentation or evolution. Here's a little quote from the book Jurassic Park.
Every biologist knows that small groups in isolation evolve fastest. You put a thousand birds on an ocean island and they’ll evolve very fast. You put ten thousand on a big continent, and their evolution slows down. Now, for our own species, evolution occurs mostly through our behavior. We innovate new behavior to adapt. And everybody on earth knows that innovation only occurs in small groups. Put three people on a committee and they may get something done. Ten people, and it gets harder. Thirty people, and nothing happens. Thirty million, it becomes impossible. -- Michael Crichton, in Jurassic Park.
Although it was a tragic ending that the application was split, but it simplified the releases. It gave us a few learning,