Micro-frontends
Micro-frontends apply the idea behind microservices to the user interface. Instead of one large frontend codebase that every team edits, the UI is split into parts, each owned end to end by one team (from database to screen), built and deployed independently, and composed into a single experience for the user.
It’s an organizational pattern first. It solves the problem of many teams blocking each other in one frontend. It doesn’t make a small app faster or simpler.
Diagram
Section titled “Diagram”- The user loads one application shell that handles routing, sign-in and page layout.
- The shell loads each team's frontend for the part of the page or route it owns.
- Each team owns its UI and the API behind it, and releases on its own schedule.
Ways to compose
Section titled “Ways to compose”| Approach | Where composition happens | Good for | Watch out for |
|---|---|---|---|
| Route-based (separate apps per URL path) | Load balancer or CDN routes /search, /checkout, /account |
The simplest start; clear ownership | Full page loads between sections; shared header duplicated |
| Server-side composition | Edge or server assembles fragments (for example, Edge Side Includes) | Fast first load, SEO | Fragment caching and failure handling |
| Client-side at build time (packages) | Each part published as a library and bundled together | Simple tooling | Not independent deploys: a release needs a rebuild of the whole app |
| Client-side at run time (Module Federation, import maps, web components) | The shell loads each part in the browser | True independent deploys | Shared dependency versions, bundle size, runtime errors |
How it works
Section titled “How it works”- Split by business domain, not by technical layer: “checkout” rather than “buttons”. Use the same boundaries as your backend services where they make sense.
- A thin shell. It handles routing, authentication, layout and loading parts. Business logic lives in the parts.
- A design system provides shared components and styles, so the product looks like one product.
- Contracts between parts: URLs, custom events or a small shared API. Avoid sharing global state.
- Agree shared dependencies. Decide which libraries (for example, the UI framework) are shared singletons and which each part bundles itself.
- Independent pipelines. Each team builds, tests and deploys its part without coordinating a release train.
- Teams ship independently, without merge queues and release trains across the whole UI.
- Clear ownership of each part of the product, end to end.
- Incremental modernization: replace an old frontend one section at a time, following the strangler fig pattern.
- Performance cost: duplicate dependencies and more network requests, unless managed carefully.
- Inconsistent user experience if the design system is weak.
- More moving parts to build, version, test together and monitor.
When to use it
Section titled “When to use it”- Several teams (often five or more) work on one frontend and block each other.
- Modernizing a large legacy frontend gradually.
- Different parts of the UI change at very different rates.
When to avoid it
Section titled “When to avoid it”With one or two frontend teams, a well-structured single codebase (a modular frontend, or a monorepo with clear module boundaries) is simpler and faster. Don’t adopt micro-frontends for technology diversity alone.
Common pitfalls
Section titled “Common pitfalls”- Splitting too finely, into dozens of tiny frontends with more coordination than before.
- Different frameworks in every part, loading several heavy runtimes on one page.
- A shared global store that couples every part together again.
- No end-to-end tests of the composed application.
Related patterns
Section titled “Related patterns”Glossary: strangler fig, bounded context
Further reading
Section titled “Further reading”- Cam Jackson, Micro Frontends (opens in a new tab) (martinfowler.com)
- Michael Geers, Micro Frontends (opens in a new tab)
- webpack, Module Federation (opens in a new tab)
Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.