Skip to content

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.

Teams own vertical slices, from API to screen1. The user loads one application shell that handles routing, sign-in and page layout. 2. The shell loads each team's frontend for the part of the page or route it owns. 3. Each team owns its UI and the API behind it, and releases on its own schedule. Usersees one product App shellrouting, sign-in, layout Design systemshared components Search UIdeployed on its own Checkout UIdeployed on its own Account UIdeployed on its own Search APIowned by same team Checkout APIowned by same team Account APIowned by same team123
Teams own vertical slices, from API to screen A thin shell composes independently deployed frontends; a shared design system keeps them looking like one product.
  1. The user loads one application shell that handles routing, sign-in and page layout.
  2. The shell loads each team's frontend for the part of the page or route it owns.
  3. Each team owns its UI and the API behind it, and releases on its own schedule.
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
  • 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.
  • 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.

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.

  • 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.

Glossary: strangler fig, bounded context

Written and edited by Abhinav Taduka, enterprise software architect.