What are micro frontends
Explain micro frontends as independently developed and deployed frontend pieces, owned by different teams, that come together as one experience.
One app, many teams
Picture an online shop. One team works on search, another on the cart, another on checkout. They all change the same frontend codebase and ship it as one app.
That works well for a while. As the app and the number of people grow, the frontend gets harder to maintain. Michael Geers calls this the frontend monolith: one frontend layer that keeps growing, often built by a separate team from the backends it sits on.
The trouble is rarely the size of the code on its own. It is that every team changes the same thing: a shared build, shared release dates and shared dependencies. A small change from one team can wait on another team’s unfinished work.
Geers describes how the microservice idea split the backend into services owned by different teams, while the frontend often stayed one layer on top of them. Micro frontends apply the same thinking to the frontend.
Split by feature, not by layer
Micro frontends start from teams, not technology. Instead of one team for the whole frontend, each team owns a feature, such as search or checkout, and builds it end to end, from its data to what the user sees.
Geers calls this organizing in verticals: each team is cross-functional and works through the whole stack for its feature.
Where you draw the line between teams decides how often they have to talk to each other. Try it: give four shop features to two teams and watch which conversations cross the boundary.
Split the monolith
Four features of a shop, Search, Cart, Checkout and Profile, start in one codebase, and you give each one to Team A or Team B. Four lines connect them, weighted by how much they talk: Cart and Checkout the most (line items and totals, 3), Search and Cart (add to cart, 2) and Checkout and Profile (address and payment, 2) less, and Profile and Search the least (personalisation, 1). Every line that ends up between two teams adds its weight to the cross-team coupling, out of 8. Putting Search and Checkout on one team and Cart and Profile on the other makes every line cross: 8 of 8, high coupling. Giving Search to Team A and the other three to Team B leaves only the light lines crossing: 3 of 8, low. Giving everything to one team is still a monolith. The weights are illustrative.
Cam Jackson makes the same point about team structure: teams own vertical slices of the product, often a whole page. He warns against horizontal teams, such as a team that only does styling, because they bring back the coordination micro frontends are meant to remove.
You will also meet “vertical” and “horizontal” used for how pieces are composed. Natalia Venditto calls it a vertical split when each app loads at its own URL, and a horizontal split when pieces from several teams share one page or view.
Delivered separately, seen as one
Cam Jackson’s article on martinfowler.com defines micro frontends as an architectural style in which frontend applications that can be delivered independently are composed into a greater whole.
Two parts of that matter. Each piece can be built, tested and released without waiting for the others. And the user should not notice the seams: they see one shop, not five apps.
“Independently deliverable” is the important phrase. Splitting code into packages or folders is not enough on its own. If every piece still goes out in one shared release, the teams have not gained the independence the style is about.
Geers lists principles that follow from this, among them: each team chooses and upgrades its own stack without coordinating, team code is isolated even when everyone uses the same framework, and the site stays useful even when JavaScript fails or has not run yet.
Where the pieces come together
Something has to put the pieces on one page. This step is called composition, and it can happen in different places:
- At build time: each piece is a package, and the shell bundles them all into one app.
- On the server: the server stitches HTML fragments from each team into one page.
- In the browser, at runtime: a shell loads each team’s code while the page runs, through JavaScript, Web Components or iframes.
The demo below puts the two ends of that list side by side: a shell that loads each team’s app while the page runs, and one that bundles every team’s package at build time. Ship one change in each and count what has to be redeployed.
Runtime composition
A shell at shop.example.com has two empty slots. With runtime composition, the shell asks each team's own server for its entry file, remoteEntry.js, while the page runs, and the team's app mounts in its slot; the shell itself is never rebuilt. When Team A ships v2, it deploys to its own server and the shell fetches the new version on the next load: only Team A's code ships, 1 of 3. With build-time integration, both apps are npm packages compiled into the shell's one bundle, so the same change rebuilds and redeploys the shell's bundle, and the code of all 3 apps ships again: Team B redeployed nothing, but its unchanged code rides along. Runtime composition saves that rebuild, and costs extra requests when the page loads, an entry file and a chunk per team app.
Where composition happens decides how independent the teams really are. Jackson points out that build-time integration brings back a lockstep release process: to change one piece, the whole app is rebuilt and released, which is why he recommends against it for micro frontends. Runtime composition lets a team release its piece without rebuilding the shell, at the cost of more moving parts in the browser.
Jackson describes runtime integration through JavaScript, where each piece exposes an entry function the shell calls to mount it, as the most flexible option and the one he sees teams adopting most often. iframes give strong isolation but make routing, deep links and responsive layouts harder. The approach pages on this site compare these options in detail.
A style, not a tool
Micro frontends are a way to organize teams and releases, not a library you install. Tools such as Module Federation or single-spa are ways to put the pieces together, and each team can still choose how it builds its own piece.
Jackson ends his article by saying that micro frontends are far from the only way to scale a frontend. The next lessons cover the problems they solve and, just as important, when they are not worth it.
A useful test: if your teams already ship independently and rarely wait on each other, you may not need micro frontends at all. The style earns its cost when coordination between teams is the thing slowing you down. That is our view, and the decision check walks through it.
Recap and check
Three things to remember
- Teams split by feature, not by layer.Each team owns a feature such as search or checkout, from its data to what the user sees.
- Each piece is delivered on its own.A team builds, tests and releases its piece without waiting for the others, and users still see one product.
- Where the pieces meet decides how independent teams are.Bundling every piece at build time ties releases together again; composing on the server or in the browser keeps them apart.
Check yourself
0 of 2 answered · nothing is scored or saved- 1
- 2
Which of these is a micro frontend architecture?
Show answer
Answer: B. A checkout page and a search page built by two teams, each released on its own, shown together in one site.
- A: Components are a way to organize code. If everything is built and released together by one team, it is a well-structured single app, not micro frontends.
- B: Separate teams, separate releases, one experience for the user. That is the core of the idea.
- C: Many single frontends talk to microservices. The question is how the frontend itself is split and released, not how many services it calls.
Team A publishes its part as an npm package that the shell installs and bundles. When Team A fixes a bug, what has to happen before users see it?
Show answer
Answer: B. The shell updates the package version, rebuilds and redeploys.
- A: Not with build-time integration. The package only reaches users inside the shell's bundle, so the shell has to be rebuilt.
- B: With build-time integration every change ships through the shell's build. That is simple, but it ties Team A's release to the shell's.