Micro Frontend vs SPA: Which Architecture Should You Choose?
Micro Frontend vs SPA is a decision every frontend team faces as their application grows. A Single Page Application (SPA) starts simple — one codebase, one build, one deployment. But as teams grow and features multiply, that simplicity becomes a bottleneck. Every feature shares the same build pipeline, every developer commits to the same repo, and a bug in one page blocks deployment of everything else.
In this article, you'll learn how SPA and Micro Frontend architectures compare, see real code examples showing both approaches, and get a clear decision framework to choose the right architecture for your project.
The Problem with Large SPAs
A Single Page Application works great for small teams and simple products. But here's what happens when a SPA grows over two years with 8+ developers:
Every user who visits your homepage downloads every dependency — including chart.js (for Analytics), xlsx (for Reports), and leaflet (for Tracking) — even though they only wanted to browse products. The bundle grows, the build slows down, and the team starts stepping on each other's toes.
This is the exact problem that Micro Frontend architecture solves.
What is a Single Page Application (SPA)?
A Single Page Application is a frontend architecture where the entire application — all pages, components, state, and routing — lives in a single codebase and produces a single build output. The browser loads one HTML file, and JavaScript handles all navigation without full page reloads.
Popular SPA frameworks include React (opens in a new tab), Angular (opens in a new tab), and Vue.js (opens in a new tab). Most frontend applications start as SPAs because they are simple to set up, have excellent tooling, and work well for small-to-medium projects.
The key characteristic of a SPA: one entry point, one build, one deployment.
What is Micro Frontend?
Micro Frontend is a frontend architecture where the application is decomposed into multiple independent applications — each with its own codebase, build pipeline, and deployment. A Host (shell) application loads these remote MFEs at runtime using Webpack Module Federation (opens in a new tab).
Instead of one giant application, you get multiple small applications that come together in the browser:
Each import() statement loads code from a different application running on a different port — not from the same bundle. This is the fundamental difference from a SPA.
New to Micro Frontend? Start with What is Micro Frontend Architecture? for the complete introduction.
Side-by-Side Comparison
Here is the fundamental difference between SPA and Micro Frontend architecture:
| Feature | SPA (Single Page Application) | Micro Frontend |
|---|---|---|
| Codebase | Single repository, single package.json | Monorepo with independent apps, each with own package.json |
| Build | One build pipeline for everything | Each MFE builds independently |
| Deployment | Deploy entire app at once | Deploy each MFE independently |
| Team scaling | All devs commit to same repo — merge conflicts | Each team owns their MFE — no conflicts |
| Build time | Grows with app size (5-10 min for large apps) | ~30 seconds per MFE (parallel via Turborepo) |
| Bundle size | All dependencies loaded on first visit | Only active MFE's dependencies loaded |
| Routing | React Router in one file | Host routes to remote MFE components |
| Shared state | One Redux store in the same bundle | Shared Redux store via Module Federation singleton |
| Technology | Locked to one framework version | Each MFE can use different versions |
| Failure isolation | Bug anywhere blocks entire deployment | Bug in one MFE only affects that MFE |
| Dev server | One port (e.g., localhost:3000) | Each MFE on its own port (4000, 4001, 4002...) |
| Infrastructure | Simple — one build, one server | More complex — Nginx routing, Module Federation config |

Key insight: SPA and Micro Frontend are not competing patterns for the same problem. SPA is the right choice for small teams. Micro Frontend is the right choice when the SPA model breaks down due to team size, build time, or deployment conflicts.
Folder Structure: SPA vs Micro Frontend
The folder structure reveals the fundamental architectural difference.
SPA Folder Structure
Everything lives under one roof — one package.json, one webpack.config.js, one dist/ output. Simple and effective for small projects.
Micro Frontend Folder Structure
Each app under apps/ is a fully independent application with its own build. Shared code lives in packages/ and is loaded as a Module Federation singleton — not bundled into each MFE.
For a detailed breakdown of MFE folder structure, read Micro Frontend Folder Structure Best Practices.
Routing: SPA vs Micro Frontend
SPA Routing — All Routes in One File
MFE Routing — Lazy-Load Remote Applications
The critical difference: in a SPA, import ProductList from './pages/ProductList' loads code from the same bundle. In a Micro Frontend, import('Products/ProductCatalog') loads code from a completely different application via Module Federation at runtime.
Webpack Configuration: SPA vs Micro Frontend
SPA — One Build Config
A SPA has one webpack.config.js that builds everything into a single dist/ folder.
Micro Frontend — Host and Remote Configs
In a Micro Frontend architecture, the Host app and each Remote MFE have their own webpack configs. The configs are different for Local Development and Production.
Local Development and Production configs are different. In local dev, remotes point to localhost:PORT. In production, Nginx serves each MFE's static files from a subpath like /products/remoteEntry.js.
Next.js Micro Frontend — Different Plugin
If your Host app uses Next.js instead of React, the configuration uses NextFederationPlugin instead of ModuleFederationPlugin:
For a detailed comparison of these two plugins, read 5 Micro Frontend Integration Patterns.
Deployment: SPA vs Micro Frontend
SPA Deployment — Single Build, Single Deploy
MFE Deployment — Independent Per Team
Turborepo orchestrates MFE builds in parallel, making the total monorepo build time comparable to or faster than a large SPA build.
Performance: SPA vs Micro Frontend
SPA Bundle Size Problem
In a SPA, the browser downloads all code on the first page load — including features the user may never visit. Code splitting helps, but all chunks still come from the same build.
MFE Targeted Loading
In a Micro Frontend, the browser only loads the Host app and the active MFE. If the user visits the Products page, only the Products MFE is downloaded. Analytics, Support, and Reports MFE code is never loaded until the user navigates there.
| Metric | SPA (Large App) | Micro Frontend |
|---|---|---|
| Initial bundle | 2-3 MB (all features) | 400-600 KB (Host + one MFE) |
| First Contentful Paint | 2.5-3.5s on 4G | 1.2-1.8s on 4G |
| Per-page load | Already loaded (fast navigation) | ~150-300 KB per MFE (lazy loaded) |
| Unused code downloaded | Yes — all features | No — only active MFE |
| Caching | One vendor chunk invalidated on any change | Each MFE cached independently |
For small applications (under 500 KB bundle), SPA is faster. The overhead of Module Federation's remoteEntry.js files and runtime negotiation adds ~50-100ms per remote. This only pays off when the alternative is loading megabytes of unused code.
When SPA is the Better Choice
Choose a SPA when:
- Small team — fewer than 5 frontend developers
- Single business domain — the app serves one purpose (e.g., a dashboard, a CMS, a blog)
- Quick MVP or prototype — you need to ship fast with minimal infrastructure
- Simple deployment — one build, one server, no Nginx routing complexity
- Build time under 2 minutes — the build pipeline is not a bottleneck yet
- No independent release cycles needed — the whole team deploys together on the same schedule
SPAs are battle-tested, well-documented, and have the largest ecosystem of tooling and libraries. There is no shame in staying with a SPA when it works.
When Micro Frontend is the Better Choice
Choose Micro Frontends when:
- Large team — 5 or more frontend developers across multiple feature areas
- Multiple business domains — products, cart, orders, analytics, support, settings
- Independent release cycles — the Products team should not wait for the Analytics team
- Build time exceeds 5 minutes — the SPA build pipeline is slowing down development
- Deployment conflicts — teams block each other because they deploy the same artifact
- Technology migration needed — you want to upgrade React 17 to React 18 one MFE at a time


Can You Migrate from SPA to Micro Frontend?
Yes — and you should do it incrementally, not as a big-bang rewrite. The strangler pattern works well:
Step 1: Create a Host app with Module Federation. Keep your existing SPA running alongside it.
Step 2: Extract one feature (e.g., Products) into a standalone MFE with its own webpack.config.js and Module Federation exposes. The Host loads it via remotes.
Step 3: Gradually extract more features into independent MFEs. Each extraction reduces the SPA and adds a new remote.
Step 4: Once all features are extracted, the original SPA becomes the Host shell — routing, layout, and navigation only.
This is exactly the approach described in Micro Frontend vs Monolith: When to Migrate.
Real-World Companies and Their Architecture
| Company | Architecture | Notes |
|---|---|---|
| Spotify | Micro Frontend | Each squad owns a feature MFE independently |
| IKEA | Micro Frontend | Catalog, cart, and checkout as separate MFEs |
| Amazon | Micro Frontend | Each product team owns their frontend slice |
| Vercel | SPA (Next.js) | Small team, single product — SPA makes sense |
| Linear | SPA (React) | Small team, single domain — fast SPA |
| Notion | SPA (React) | Single product, one deployment pipeline |
| Most startups | SPA | Team too small for MFE overhead |
The pattern is clear: small teams and single-domain products stay with SPA. Large organizations with multiple product teams adopt Micro Frontends.
For more on how Micro Frontends connect to backend Microservices in production, read Micro Frontend vs Microservices: Key Differences.
Summary
| Aspect | SPA | Micro Frontend |
|---|---|---|
| Best for | Small teams, single domain | Large teams, multiple domains |
| Codebase | One repo, one build | Monorepo with independent apps |
| Deployment | Deploy everything together | Deploy each MFE independently |
| Build time | Grows with app size | ~30 seconds per MFE |
| Bundle | All code loaded upfront | Only active MFE loaded |
| Complexity | Low | Higher (Module Federation, Nginx) |
| Team autonomy | Low — shared codebase | High — independent repos/apps |
| Migration | N/A | Incremental (strangler pattern) |
Start with a SPA. Migrate to Micro Frontend when the SPA model breaks. The decision is driven by team size, deployment conflicts, and build time — not by trend or resume-driven development. If your 3-person team is shipping just fine with a SPA, you do not need Micro Frontends.
What's Next?
This completes the MFE Fundamentals section. You now understand what Micro Frontends are, how they compare to monoliths, SPAs, and microservices, and when to adopt them.
The next section dives into hands-on implementation — setting up a React Micro Frontend monorepo with Turborepo, Webpack 5, and Module Federation from scratch.
← Back to Micro Frontend vs Microservices
Continue to React MFE Monorepo Setup with Turborepo →
Frequently Asked Questions
What is the difference between a SPA and a Micro Frontend?
A Single Page Application (SPA) is one monolithic frontend application where all features share a single codebase, build pipeline, and deployment. A Micro Frontend splits the frontend into multiple independent applications — each with its own codebase, build, and deployment — loaded at runtime by a Host app using Webpack Module Federation.
When should I use SPA instead of Micro Frontend?
Use a SPA when your team is small (fewer than 5 frontend developers), the application has a single business domain, you need a quick MVP or prototype, and deployment coordination is not a bottleneck. SPAs have less infrastructure overhead and are simpler to set up and maintain for small projects.
When should I use Micro Frontend instead of SPA?
Use Micro Frontends when you have 5 or more frontend developers, multiple business domains (products, cart, orders, analytics), teams that need independent release cycles, or when your SPA build time exceeds 5 minutes. Micro Frontends enable independent deployment, parallel development, and team autonomy.
Can you migrate from SPA to Micro Frontend?
Yes. You can migrate incrementally by first creating a Host app with Module Federation, then extracting one feature (like Products) into a remote MFE while keeping the rest in the SPA. Gradually extract more features into independent MFEs. This strangler pattern avoids a risky big-bang rewrite.
Is Micro Frontend better than SPA for performance?
It depends on the application size. For small apps, SPAs are faster because there is no overhead from loading remote entry files. For large apps with many features, Micro Frontends perform better because users only download the code for the MFE they are visiting — not the entire application. Each MFE typically loads 150-300 KB compared to 2-3 MB for a large SPA.
Do Micro Frontends replace React Router?
No. Micro Frontends still use React Router (or Next.js routing) for navigation. The Host app uses React Router to map URL paths to remote MFE components loaded via Module Federation. Each MFE can also have its own internal routing. Module Federation handles code loading, not routing.