Frontend School
DashboardProblemsLearnPracticeMock InterviewReportsStatsBuy Credits
DashboardProblemsLearnPracticeMock Interview
Frontend System Design Roadmap
  1. 1.HTTP/1.1 vs HTTP/2 vs HTTP/3 (QUIC)
  2. 2.TCP and TLS Handshakes: Connection Setup Costs
  3. 3.Browser Network Stack and Connection Pooling
  4. 4.GET vs POST and Idempotency in HTTP
  5. 5.The Critical Rendering Path (CRP)
  6. 6.DOM, CSSOM and the Render Tree
  7. 7.Layout, Paint and Compositing
  8. 8.Reflows and Repaints Explained
  9. 9.Event Loop: Call Stack, Task and Microtask Queues
  10. 10.Async JavaScript: Promises and async/await
  11. 11.Web Workers: Multi-threading in the Browser
  12. 12.Browser Storage: Cookies, Web Storage, IndexedDB
  13. 13.Client-Side Storage: Limits and Security Risks
  14. 14.Choosing the Right Client-Side Storage
  15. 15.HTTP Caching: Cache-Control, ETag, Last-Modified
  16. 16.Browser-Level Caching Mechanisms
  17. 17.Cache Invalidation for Frontend Apps
  18. 18.Structuring a Large Single-Page App
  19. 19.Component-Based Architecture Principles
  20. 20.Props, State and Component Lifecycle
  21. 21.Module Bundling Basics
  22. 22.Core Web Vitals: LCP, INP and CLS
  23. 23.FCP and Time to Interactive (TTI) Explained
  24. 24.Measuring Performance: Lighthouse and WebPageTest
  25. 25.Asset Compression and Minification Basics
  26. 26.What Is a CDN and How Does It Work?
  27. 27.CDN Benefits: Latency, Availability, Offload
  28. 28.CDN Cache Behavior and Invalidation
  29. 29.Global State vs Local Component State
  30. 30.State Patterns: Redux, Zustand and Context
  31. 31.Data Fetching: React Query and SWR
  32. 32.Immutable Data in Frontend State
  33. 33.SSR vs CSR: Rendering Trade-offs
  34. 34.Hydration and Time to First Byte (TTFB)
  35. 35.Static Site Generation (SSG) for Speed and SEO
  36. 36.Incremental Static Regeneration (ISR)
  37. 37.Micro-Frontends: Core Principles
  38. 38.Micro-Frontend Integration Strategies
  39. 39.Communication Between Micro-Frontends
  40. 40.Micro-Frontends: Pros and Cons for Large Teams
  41. 41.Real-Time: Polling, SSE and WebSockets
  42. 42.Real-Time Use Cases: Chat, Alerts, Live Data
  43. 43.Designing a Real-Time Data Flow
  44. 44.Scaling WebSocket Connections
  45. 45.Responsive Images: srcset, sizes and picture
  46. 46.Modern Image Formats: WebP, AVIF, JPEG XL
  47. 47.Lazy Loading Images and Videos
  48. 48.Video Streaming: HLS, DASH, Adaptive Bitrate
  49. 49.REST and GraphQL for Frontend Engineers
  50. 50.Batching, Throttling and Debouncing API Calls
  51. 51.Handling API Errors in the Frontend
  52. 52.Authentication Flows: OAuth and JWT
  53. 53.Global Error Boundaries in React
  54. 54.Error Reporting: Sentry and LogRocket
  55. 55.Graceful Degradation and Fallback UIs
  56. 56.Real User Monitoring (RUM)
  57. 57.CORS: Cross-Origin Resource Sharing
  58. 58.Preventing XSS (Cross-Site Scripting)
  59. 59.CSRF Protection for Frontend Apps
  60. 60.Content Security Policy (CSP)
  61. 61.Storing Auth Tokens: Cookies vs localStorage
  62. 62.PWA Manifest and Installability
  63. 63.Service Workers: Lifecycle and Caching Strategies
  64. 64.Offline Support and Background Sync
  65. 65.Push Notifications for Web Apps
  66. 66.Webpack vs Vite vs Parcel
  67. 67.Code Splitting, Tree Shaking, Asset Optimization
  68. 68.Module Resolution and Hot Module Replacement
  69. 69.Monorepo Tooling: Nx and Lerna
  70. 70.Atomic Design for Component Libraries
  71. 71.Theming and Customization in Design Systems
  72. 72.Accessibility in Component Libraries
  73. 73.Component Library Docs, Testing and Versioning
  74. 74.Publishing and Consuming a Component Library
  75. 75.Full-Text Search: Levenshtein and Fuzzy Matching
  76. 76.Indexing Large Datasets in the Browser
  77. 77.Search Performance: Debouncing and Web Workers
  78. 78.Integrating Backend Search Services
  79. 79.Choosing a Chart Library: D3, Chart.js, Recharts
  80. 80.Rendering Large Datasets: Canvas vs SVG
  81. 81.Interactive, Responsive Data Visualizations
  82. 82.Data Fetching and Aggregation for Dashboards
  83. 83.A/B Test Design and Rollout Strategies
  84. 84.Client-Side vs Server-Side A/B Testing
  85. 85.Feature Flags and Remote Configuration
  86. 86.Experiment Data Collection and Analytics
Frontend System Design Roadmap
40

Frontend System Design · Lesson 40 of 86 · 5 min

Micro-Frontends: Pros and Cons for Large Teams

This is how you justify a complex architectural choice and prove you understand its real-world costs.

After this lesson, you'll be able to explain when micro-frontends are a potential solution, what problems they solve, and—more importantly—what new problems they create. This isn't a silver bullet; it's a specific tool for a specific type of organizational pain. Knowing the trade-offs is what separates a senior answer from a junior one.

When to Even Consider This Pattern

Micro-frontends are a response to a scaling problem, but it's an organizational scaling problem, not a technical one. You don't adopt this pattern because your app is slow or has too many components. You adopt it because you have too many teams tripping over each other in a single codebase.

The trigger is usually when your organization grows to 5+ frontend teams working on the same product. Communication overhead explodes. A simple change requires coordinating with three other teams. Deployments become slow, risky release trains. This is Conway's Law in action: your monolithic frontend architecture is fighting your multi-team organizational structure.

Micro-frontends propose to solve this by aligning the architecture with the team structure. Each team gets its own piece of the application to build, deploy, and own independently.

The trap: Candidates often propose micro-frontends too early. If you're asked to design a system for a small team, suggesting micro-frontends is a red flag. It shows you're chasing a buzzword without understanding the cost. Always frame it as a solution for organizational scaling, not a default choice.

The Primary Benefit: Restoring Team Autonomy

The entire point of this architecture is to give teams back their autonomy. This isn't just a vague sense of ownership; it has three concrete benefits.

  1. Independent Deployments. This is the number one reason. The search team can deploy a change to the search bar five times a day without coordinating with the checkout team. This drastically reduces release risk and eliminates bottlenecks, allowing teams to ship features faster.

  2. Decoupled Codebases. Each micro-frontend is its own application, often in its own repository. This means a clean boundary. Team A can't accidentally break Team B's code. Onboarding is simpler because a new engineer only needs to understand one small part of the whole system.

  3. Tech Stack Flexibility. The checkout team can upgrade to a new version of React without forcing the entire company to do a massive, coordinated migration. In theory, one team could even use Vue while another uses Svelte. While this is powerful, it's also dangerous if not governed properly, as it can lead to a fragmented developer experience and inconsistent UX.

The Real Costs: Complexity and Fragmentation

Micro-frontends are not free. You are trading the coordination complexity of a monolith for a significant increase in technical and operational complexity.

Operational Overhead is the biggest cost. You no longer have one build pipeline and one deployment process. You have N+1: one for each micro-frontend and one for the "shell" application that orchestrates them. This requires significant investment in CI/CD, monitoring, and infrastructure. You will likely need a dedicated platform or developer experience team to manage this.

Performance can easily get worse. A naive implementation means each micro-frontend bundles its own dependencies. The user ends up downloading React three times on the same page. The solution is to share common dependencies (like react and react-dom) between micro-frontends, which requires careful configuration.

User Experience becomes fragmented. If teams are truly autonomous, they will inevitably create slightly different-looking buttons, modals, and form fields. Maintaining a consistent look and feel becomes a major challenge. This makes a robust, versioned, and shared design system an absolute prerequisite. The design system becomes the new integration point teams must coordinate on.

How to Structure Your Answer in an Interview

When asked to design a large-scale frontend, don't jump straight to micro-frontends. Show your thought process.

  1. Start with the monolith. A monolith is the right default choice. State that you would start there. It's simpler to build, deploy, and test.

  2. Identify the scaling inflection point. Describe the organizational pain points that would make you reconsider the monolith: "As the organization grows to, say, 50+ engineers across 7-8 teams, we'd see coordination overhead slowing us down. Release cycles would get longer. That's the point where I would evaluate a move to micro-frontends."

  3. Propose micro-frontends as the solution. Explain that the goal is to increase team velocity by enabling independent deployments. Briefly mention a technical approach, like using Webpack's Module Federation.

  4. Immediately state the costs. This is critical. Follow up with: "However, this introduces significant operational complexity and performance risks. We would need a shared dependency strategy to avoid duplicate bundles. We'd also need a strong, shared design system to prevent UX fragmentation. This likely requires a dedicated platform team to support the architecture."

This structure shows you understand the entire life cycle of the decision, not just the happy path.

A Concrete Implementation: Module Federation

Webpack's Module Federation is a common way to implement micro-frontends. It allows a host application to dynamically load code from a separately deployed remote application at runtime.

This example shows a host app loading a Widget from a remote app. Note how react and react-dom are configured as singletons to ensure they are only loaded once on the page.

// host/webpack.config.js
const { ModuleFederationPlugin } = require('webpack').container;
const deps = require('./package.json').dependencies;

module.exports = {
  // ...
  plugins: [
    new ModuleFederationPlugin({
      name: 'host',
      remotes: {
        // 'remote' is the name of the remote app
        // 'http://localhost:3001/remoteEntry.js' is where it's hosted
        remote: 'remote@http://localhost:3001/remoteEntry.js',
      },
      shared: {
        react: { singleton: true, requiredVersion: deps.react },
        'react-dom': { singleton: true, requiredVersion: deps['react-dom'] },
      },
    }),
  ],
};

// remote/webpack.config.js
const { ModuleFederationPlugin } = require('webpack').container;
const deps = require('./package.json').dependencies;

module.exports = {
  // ...
  plugins: [
    new ModuleFederationPlugin({
      name: 'remote',
      filename: 'remoteEntry.js',
      exposes: {
        // Expose the Widget component from './src/Widget'
        './Widget': './src/Widget',
      },
      shared: {
        react: { singleton: true, requiredVersion: deps.react },
        'react-dom': { singleton: true, requiredVersion: deps['react-dom'] },
      },
    }),
  ],
};

This configuration directly addresses the performance problem by de-duplicating shared libraries, while enabling the core benefit of independent deployments.

Try it

Take a large application you use, like Amazon, Netflix, or your company's product. Sketch out on paper which parts of the UI could be separate micro-frontends. Identify at least three. Now, list two things they would need to share (e.g., authentication state, a user ID, a component library). How would they communicate?

Next: We'll discuss the three main patterns for getting real-time data to the client in the lesson on Real-Time: Polling, SSE and WebSockets.

Lock it in — apply this lesson under interview conditions.

Try a free mock interviewPractice system design problems
Previous

Communication Between Micro-Frontends

Next

Real-Time: Polling, SSE and WebSockets