Microfrontends

Last updated Feb 14, 2026 Published May 8, 2024

The content here is under the Attribution 4.0 International (CC BY 4.0) license

Join Our Community

Connect with developers, architects, and tech leads who share your passion for quality software development. Discuss TDD, architecture, software engineering, and more.

→ Join Slack

Microfrontends extend the concept of microservices to the frontend world. They involve breaking down a web application into smaller, more manageable pieces, each owned by different teams. This allows for independent development, deployment, and scaling of frontend components. Each microfrontend can be built using different technologies and frameworks, enabling teams to choose the best tools for their specific needs. This approach enhances flexibility, reduces dependencies, and accelerates the development process by allowing teams to work in parallel on different parts of the application.

Introduction

The term “micro frontends” first appeared around 2016, extending the principles of microservices architecture to the frontend domain (Jackson, 2019). The architectural pattern emerged from the need to address challenges in large-scale web applications where traditional monolithic frontend architectures were becoming difficult to maintain and scale.

Traditional frontend applications are typically built as a single, monolithic codebase that grows in complexity over time. As teams expand and product requirements evolve, this monolithic approach presents challenges including longer build times, increased coordination overhead between teams, and difficulties in adopting new technologies. Microfrontends address these issues by decomposing the frontend into smaller, independently deployable units.

(Peltonen et al., 2021) conducted a multivocal literature review identifying key motivations for adopting microfrontends, including independent deployability (allowing teams to release features without coordinating with other teams), technology diversity (enabling different frameworks or libraries for different parts of the application), and team autonomy (empowering teams to make technical decisions independently).

The evolution from monoliths to microfrontends

The transition from monolithic frontends to microfrontends mirrors the backend evolution from monoliths to microservices. However, the frontend presents unique challenges, particularly around user experience consistency, performance optimization (bundle sizes, loading times), and state management across independently developed components. (Pavlenko et al., 2020) describes microfrontends as the application of microservices principles to web frontends, emphasizing the architectural similarities while acknowledging the distinct challenges of frontend development.

Core principles

Microfrontends are built on several foundational principles that distinguish them from traditional frontend architectures:

  1. Technology agnostic: Each microfrontend can be implemented using different frameworks (React, Vue, Angular, or even vanilla JavaScript), allowing teams to choose the best tool for their specific requirements
  2. Independent deployment: Teams can deploy their microfrontends independently without coordinating releases with other teams, reducing deployment complexity and accelerating time to market
  3. Isolated runtime: Microfrontends run in isolation at runtime, preventing one component from inadvertently breaking another
  4. Team ownership: Each microfrontend is owned by a single team, responsible for its development, testing, deployment, and maintenance
  5. Vertical slicing: Rather than organizing teams by technical layer (frontend, backend, database), teams are organized around business capabilities, owning the full stack for their domain

Architecture patterns

Several architectural patterns have emerged for implementing microfrontends, each with different trade-offs regarding complexity, performance, and team autonomy (Geers, 2020).

Build-time integration

In build-time integration, microfrontends are composed during the build process, typically using package managers like npm. Each microfrontend is published as a package, and the container application includes them as dependencies.

This approach offers simplicity and good performance since everything is bundled together. However, it sacrifices independent deployability, the core benefit of microfrontends. When one team updates their microfrontend, the container application must be rebuilt and redeployed, creating coordination overhead.

Server-side composition

Server-side composition assembles the final page on the server by combining HTML fragments from different microfrontends. This pattern, often implemented using technologies like Server-Side Includes (SSI), Edge-Side Includes (ESI), or frameworks like Tailor or Podium, provides good initial load performance and SEO benefits.

The server acts as a composition layer, requesting HTML fragments from different microfrontend services and stitching them together before sending the complete page to the browser. This approach maintains independent deployability while providing good performance characteristics, particularly for content-heavy applications.

Client-side composition

Client-side composition loads and renders microfrontends in the browser, typically using JavaScript. The container application (often called the shell or host) is responsible for loading the appropriate microfrontends and rendering them in designated areas of the page.

This pattern offers maximum flexibility and can provide smooth transitions between microfrontends without full page reloads. However, it can introduce performance challenges related to JavaScript bundle sizes and initial load times. Technologies like Module Federation (introduced in Webpack 5) (Jackson, 2020) have significantly improved this approach by enabling better code sharing and dynamic loading.

Webpack Module Federation

Webpack 5’s Module Federation represents a paradigm shift in how JavaScript applications can share code at runtime. Rather than requiring all dependencies to be bundled at build time, Module Federation allows applications to dynamically load code from other independently deployed applications. This enables true independent deployability while still allowing for efficient code sharing, addressing one of the primary challenges of microfrontend architectures.

Web Components

Web Components leverage browser standards (Custom Elements, Shadow DOM, HTML Templates) to create encapsulated, reusable components. Each microfrontend can be implemented as a Web Component, providing framework-agnostic integration.

This approach offers excellent encapsulation and doesn’t lock teams into specific frameworks. However, Web Components have limitations, particularly around server-side rendering and integration with certain frameworks. Additionally, teams must carefully manage the balance between encapsulation and shared styling to maintain a consistent user experience.

iframe-based composition

Using iframes is perhaps the oldest approach to frontend composition. Each microfrontend runs in its own iframe, providing complete isolation between components. While this offers strong encapsulation and security boundaries, iframes introduce significant challenges including performance overhead, complex routing, difficulties with responsive design, and user experience issues (such as managing browser history and deep linking).

Despite these limitations, iframes remain relevant in specific scenarios, particularly when integrating third-party content or maintaining strict security boundaries between components.

Integration strategies

Integrating microfrontends requires careful consideration of how they communicate, share resources, and maintain a consistent user experience (Mezzalira, 2021).

Routing and navigation

Routing in microfrontend architectures requires coordination between the container application and individual microfrontends. The container typically owns the top-level routing, determining which microfrontend should be rendered based on the current URL. Individual microfrontends may handle their own internal routing for nested views.

Several strategies exist for implementing routing:

  1. Container-managed routing: The container application owns all routing logic and activates microfrontends based on route matches
  2. Distributed routing: Each microfrontend registers its routes with the container, enabling more decentralized control
  3. URL-based: Different microfrontends are served from different paths or subdomains

Frameworks like Single-SPA (Single-SPA, 2023) provide sophisticated routing capabilities, allowing multiple microfrontends to be active simultaneously and handling complex routing scenarios.

Shared dependencies

Managing shared dependencies presents a significant challenge in microfrontend architectures. Duplicating common libraries (such as React, utility libraries, or design system components) across microfrontends increases bundle sizes and can negatively impact performance.

Strategies for managing shared dependencies include:

  1. External dependencies: Marking common libraries as externals and loading them from a CDN or shared bundle
  2. Module Federation: Using Webpack’s Module Federation to share dependencies at runtime
  3. Import maps: Leveraging browser-native import maps to control module resolution
  4. Version coordination: Establishing team agreements on shared library versions

The choice of strategy depends on factors including the number of microfrontends, team coordination capabilities, and performance requirements.

Communication between microfrontends

Microfrontends occasionally need to communicate with each other, whether to synchronize state, trigger actions, or share data. However, direct coupling between microfrontends should be minimized to maintain independence.

Common communication patterns include:

  1. URL parameters: Passing data through the URL, suitable for navigation state
  2. Custom events: Using browser custom events for loosely coupled communication
  3. Shared state: Maintaining minimal shared state in the container application, though this should be used sparingly to avoid coupling
  4. Backend coordination: Coordinating through backend services rather than direct frontend communication

(Jackson, 2019) emphasizes that microfrontends should primarily communicate through the backend, treating the frontend as a composition layer rather than a place for complex integration logic.

Styling and design consistency

Maintaining a consistent look and feel across independently developed microfrontends requires coordination and tooling. Organizations typically adopt one of these approaches:

  1. Shared design system: Publishing a design system as a package that all microfrontends consume
  2. CSS-in-JS with theming: Using CSS-in-JS solutions that support theming to maintain consistency
  3. CSS namespacing: Using naming conventions (like BEM) to avoid style conflicts while sharing stylesheets
  4. Shadow DOM: Leveraging Shadow DOM for style encapsulation when using Web Components

The design system approach is most common, allowing teams to independently implement components while maintaining visual consistency. However, this requires governance to ensure the design system evolves without breaking existing microfrontends.

Deployment and orchestration

Deploying microfrontends requires infrastructure that supports independent deployability while maintaining system reliability (Bass et al., 2015).

Independent deployment pipelines

Each microfrontend should have its own continuous integration and deployment (CI/CD) pipeline, enabling teams to deploy changes independently. This requires:

  1. Isolated build processes: Each microfrontend has its own build configuration and artifacts
  2. Version management: Clear versioning strategies for microfrontends and shared dependencies
  3. Deployment coordination: While deploys are independent, mechanisms for testing integration are needed
  4. Rollback capabilities: Ability to quickly rollback problematic deployments without affecting other microfrontends

Content Delivery Networks and caching

Microfrontends benefit significantly from CDN distribution, reducing latency and improving load times. Key considerations include:

  1. Cache invalidation: Strategies for invalidating cached microfrontends when new versions are deployed
  2. Bundle naming: Using content hashes in bundle names to enable long-term caching
  3. Asset organization: Organizing assets to enable efficient caching and updates

Container application management

The container application requires special attention as it serves as the entry point for users and coordinates microfrontends. Deployment strategies for the container include:

  1. Minimal container: Keeping the container as simple as possible, primarily responsible for loading microfrontends
  2. Configuration-driven: Using external configuration to determine which microfrontend versions to load
  3. Canary deployments: Gradually rolling out new microfrontend versions to subsets of users

Netflix’s approach using Lattice (Blog, 2022) demonstrates sophisticated orchestration, using a configuration-driven system that allows teams to deploy microfrontends independently while maintaining control over which versions are active in production.

Testing strategies

Testing microfrontend architectures requires approaches that balance unit testing, integration testing, and end-to-end testing across independently developed components.

Unit and component testing

Each microfrontend should have comprehensive unit and component tests, following standard testing practices for the chosen framework. These tests validate the microfrontend in isolation, providing fast feedback during development.

Integration testing

Integration testing in microfrontend architectures focuses on verifying that microfrontends work correctly when composed together. This includes:

  1. Contract testing: Using tools like Pact to verify that the container application and microfrontends maintain compatible interfaces
  2. Composition testing: Testing the container’s ability to load and render microfrontends correctly
  3. Communication testing: Verifying that communication patterns (events, shared state) work as expected

End-to-end testing

End-to-end tests validate complete user workflows that may span multiple microfrontends. These tests are typically slower and more brittle, so they should focus on critical user journeys rather than comprehensive coverage.

Strategies for effective E2E testing include:

  1. Testing against production-like environments with all microfrontends deployed
  2. Using feature flags to test new microfrontend versions alongside existing ones
  3. Maintaining a balance between test coverage and test maintenance burden

Performance testing

Performance testing is particularly important in microfrontend architectures due to the potential for increased bundle sizes and network requests. Key metrics include:

  1. Initial load time: Measuring time to interactive for the full application
  2. Bundle size analysis: Monitoring the size of individual microfrontends and shared dependencies
  3. Runtime performance: Ensuring that composition and communication overhead doesn’t degrade user experience

Challenges and trade-offs

While microfrontends offer benefits, they introduce complexity and require careful consideration of trade-offs (Peltonen et al., 2021).

Increased complexity

Microfrontend architectures add operational and technical complexity including:

  1. Infrastructure overhead: Each microfrontend requires its own deployment pipeline, monitoring, and infrastructure
  2. Coordination challenges: While teams are independent, some coordination is still needed for shared dependencies, design systems, and cross-cutting concerns
  3. Debugging complexity: Tracing issues across multiple independently deployed microfrontends can be challenging

Performance considerations

Performance can suffer in microfrontend architectures due to:

  1. Duplicate dependencies: Without careful management, common libraries may be loaded multiple times
  2. Network overhead: Additional requests for loading microfrontends can increase load times
  3. Bundle size growth: The total JavaScript payload may increase compared to a well-optimized monolith

(Raj et al., 2025) found that while microfrontends can improve maintainability, organizations must carefully monitor performance metrics and implement optimization strategies.

Consistency challenges

Maintaining consistency across independently developed microfrontends requires:

  1. Design system governance: Ensuring all teams use the design system correctly
  2. User experience coordination: Maintaining consistent interactions, navigation, and behavior
  3. Accessibility: Ensuring all microfrontends meet accessibility standards

When to use microfrontends

Microfrontends are not universally appropriate. They are most beneficial when:

  1. Multiple teams need to work on the same frontend application
  2. Different parts of the application have significantly different requirements or lifecycles
  3. The organization values team autonomy and independent deployability over architectural simplicity
  4. The application is large enough to justify the overhead

For smaller applications or teams, a well-structured monolithic frontend may be more appropriate, offering simplicity without sacrificing maintainability.

Practical examples

Several organizations have successfully implemented microfrontends at scale, providing valuable lessons for those considering this architecture.

Netflix and Lattice

Netflix developed Lattice, a framework for building microfrontends that emphasizes developer experience and performance. Their approach uses server-side rendering combined with client-side hydration, allowing teams to build microfrontends with React while maintaining excellent performance (Blog, 2022).

Key aspects of Netflix’s approach include:

  1. Configuration-driven composition: A centralized configuration system determines which microfrontends are active
  2. Shared platform services: Netflix provides platform services for common concerns like authentication and data fetching
  3. Performance monitoring: Comprehensive monitoring ensures microfrontends meet performance budgets

IKEA

IKEA uses microfrontends to enable multiple teams to contribute to their e-commerce platform. Their architecture emphasizes:

  1. Web Components for encapsulation
  2. Server-side composition for initial page loads
  3. Client-side enhancement for interactive features

Spotify

Spotify employs microfrontends to allow different teams to own different parts of their web player. They focus on:

  1. Clear ownership boundaries aligned with business capabilities
  2. Shared design system for consistency
  3. Centralized routing and navigation

Resources

Primary literature

Books

Blog posts and articles

Frameworks and tools

  • (Single-SPA, 2023) - Framework for building microfrontend applications
  • (Jackson, 2020) - Webpack’s Module Federation for runtime code sharing
  • Bit - Component-driven development platform supporting microfrontends
  • Piral - Framework for building portal applications with microfrontends

Code examples

References

  1. Jackson, C. (2019). Micro Frontends. https://martinfowler.com/articles/micro-frontends.html
  2. Peltonen, S., Mezzalira, L., & Taibi, D. (2021). Motivations, benefits, and issues for adopting Micro-Frontends: A Multivocal Literature Review. Information and Software Technology, 136, 106571. https://doi.org/10.1016/j.infsof.2021.106571
  3. Pavlenko, A., Askarbekuly, N., Megha, S., & Mazzara, M. (2020). Micro-frontends: application of microservices to web front-ends. Journal of Internet Services and Applications, 11(1), 1–12. https://doi.org/10.1186/s13174-020-00128-5
  4. Geers, M. (2020). Micro Frontends in Action.
  5. Jackson, Z. (2020). Webpack 5 Module Federation: A game-changer in JavaScript architecture. https://webpack.js.org/concepts/module-federation
  6. Mezzalira, L. (2021). Building Micro-Frontends.
  7. Single-SPA. (2023). Single-SPA: A javascript framework for front-end microservices. https://single-spa.js.org
  8. Bass, L., Weber, I., & Zhu, L. (2015). DevOps: A Software Architect’s Perspective.
  9. Blog, N. T. (2022). How We Build Micro Frontends With Lattice. https://netflixtechblog.com/how-we-build-micro-frontends-with-lattice-22b8635f77ea
  10. Raj, P., Raman, A., & Nagaraj, D. (2025). Maintainability improvement of microservices based applications using micro frontend. Journal of Statistics and Management Systems, 28(1), 1–15. https://doi.org/10.1080/1206212X.2025.2450250
  11. Yang, J., Zhang, W., & Li, Z. (2022). A Survey on Micro Frontend Architecture. ArXiv Preprint ArXiv:2210.13293. https://arxiv.org/abs/2210.13293

You also might like