Frontend Architectures — From MPA to Micro-Frontends
A field guide to the evolution of frontend architectures over the past three decades. From server-rendered multi-page apps through client-heavy SPAs to today's hybrid models — SSR, SSG, ISR, Islands, and Micro-Frontends — this article unpacks the trade-offs, the patterns, and the decisions that define how we build for the web.
FrontendX EngineeringSystem Design Series
What Are We Building?
"When you start a new frontend project, which architecture do you pick?" I get asked this every few months — by juniors starting their first real app, by seniors evaluating a rewrite, by architects choosing a platform strategy. There is no single right answer, but there is a right way to think about the question.
A frontend architecture is the set of decisions that determine how code is organized, how data flows, how pages are rendered, and how the application is deployed. It is the skeleton that every feature, every component, and every route hangs on. Get it right and the team moves fast for years. Get it wrong and every new feature feels like squeezing another suitcase into an already-overstuffed closet.
Over the past 25 years, five major architectural paradigms have emerged:
Multi-Page Application (MPA) — each navigation triggers a full page reload. The server owns rendering.
Single-Page Application (SPA) — one HTML shell, all rendering and routing happen on the client via JavaScript.
Server-Side Rendering (SSR) / Static Site Generation (SSG) — the server (or build step) pre-renders HTML, the client hydrates it.
Micro-Frontends — multiple independently-deployed applications composed into a single page.
Figure 1 — Evolution of frontend architectures: from server-rendered MPAs through client-heavy SPAs to today's hybrid models.
Each architecture changes what the build step produces, what the server does at request time, and what the client executes. The evolution is not linear — new architectures don't replace old ones, they expand the toolkit. I have shipped production apps in every one of these paradigms, and the lesson is always the same: there are no bad architectures, only misapplied ones.
1 · Requirements & Scoping
Choosing an architecture is a requirements-gathering exercise. Here are the questions I ask before committing to a pattern.
Functional requirements
Page navigation: Users navigate between pages via links, the browser back button, and direct URL entry. The architecture must handle routing — either server-side (MPA, SSR) or client-side (SPA, Micro-FEs).
Content rendering: Pages display dynamic content from an API or database. The architecture decides whether this content is rendered at build time, request time, or on the client.
Client interactivity: Buttons, forms, drag-and-drop, real-time updates. Some architectures hydrate the entire page (SSR), some hydrate in chunks (Islands), some are interactive by default (SPA).
Authentication & authorization: Protected routes, role-based access, session management. The architecture defines where auth checks run — middleware, server functions, or client-side guards.
Search engine discoverability: Public pages must be indexable by crawlers. SSR/SSG serve full HTML; SPAs rely on prerendering or dynamic rendering for bots.
Offline support: The app should work without a network connection. Service workers, local storage, and IndexedDB matter more for SPAs and require architectural buy-in from day one.
Non-functional requirements
Performance (LCP, TTI, TBT): Largest Contentful Paint should be under 2.5s. Time to Interactive under 3.5s. Different architectures trade these off — SSG wins LCP, SPA wins subsequent navigation speed.
Developer experience: How fast can a new engineer be productive? How long does the build take? How easy is debugging? SPA tooling is mature; SSR/SSG with modern frameworks adds complexity.
Deploy granularity: Can you deploy one page without redeploying everything? Micro-FEs shine here; MPAs and monolithic SPAs bundle the whole app.
Scalability (team): How many teams work on the codebase? Monorepo with shared components works for small teams; Micro-FEs reduce coordination overhead for large organizations.
Tip
I deliberately left out "real-time collaboration" and "offline-first" as core requirements — those are specialized needs that push you toward specific architectures (CRDT-based sync for Notion-like apps, service-worker caching for PWAs). If those are your primary requirements, skip this article and read the Notion-Like Workspace article instead.
2 · Architecture & High-Level Design
Let's walk through each architecture at a high level, then compare them.
Multi-Page Application (MPA)
The original web architecture. Each page is a complete HTML document generated by the server. Clicking a link tears down the current page, the browser requests a new document, and the server sends back the full HTML. Frameworks like Ruby on Rails, Django, and Laravel epitomize this pattern. JavaScript is progressive enhancement, not a requirement.
MPAs excel at content-heavy sites where SEO matters and interactivity is minimal. Wikipedia, The Guardian, and most e-commerce product pages are MPAs. The trade-off: every navigation is a full page load, which means a blank flash and a fresh JavaScript context.
Single-Page Application (SPA)
The server sends a minimal HTML shell and a large JavaScript bundle. The client takes over: it manages routing, renders views, fetches data, and updates the DOM — all without full page reloads. React, Vue, and Angular are the dominant SPA frameworks. Gmail, Figma, and Notion are SPAs.
SPAs win on subsequent navigation speed — after the initial load, navigating between pages is instant because only data changes, not the shell. The cost: a large initial bundle, poor SEO without workarounds, and a harder mental model for routing and state management.
SSR / SSG (the "modern" hybrid)
Next.js, Remix, Nuxt, and SvelteKit popularized the hybrid model: the same framework can SSR at request time (dynamic), SSG at build time (static), or ISR (incremental static regeneration — serve cached, revalidate in background). The framework abstracts the rendering strategy per route.
The killer feature is the per-route rendering strategy. A marketing page can be SSG (fastest LCP), a dashboard can be SSR (dynamic data), and a blog index can be ISR (fresh enough). All three live in the same codebase, same deployment. This is the architecture I reach for by default in 2026.
Islands Architecture
Astro pioneered the Islands pattern: the server delivers fully-formed static HTML, and only the interactive "islands" of the page hydrate into independent React/Vue/Svelte components. The rest of the page remains static — no JavaScript, no hydration, no overhead.
Islands solve the hydration tax problem: in standard SSR, every component on the page hydrates, even ones that never need client-side interactivity (like a footer or a static hero image). Islands hydrate only the interactive parts, loading JavaScript lazily as the components scroll into view.
Micro-Frontends
Micro-Frontends apply the microservices philosophy to the frontend: each team builds and deploys an independent application, and a "shell" composes them into a single page. Integration happens at runtime via iframes, Web Components, or Module Federation (Webpack 5).
The promise: teams deploy independently, use different frameworks, and scale without coordinating. The reality: shared auth, consistent UX, cross-app routing, and bundle duplication are hard problems. Micro-FEs are a team-scale solution, not a technical one.
Decision framework
Here is how I think about the choice:
Content-dominant site
Blog, docs, marketing → MPA or SSG. Fast initial load, great SEO, minimal JS. Reach for Astro or Next.js SSG.
App-dominant site
Dashboard, email client, editor → SPA or SSR. Rich interactivity matters more than initial load. Reach for Next.js or Remix.
Mixed content + app
E-commerce, SaaS platform → SSR/SSG hybrid. Some pages static, some dynamic. Reach for Next.js with per-route rendering.
Multi-team product
Enterprise portal, marketplace → Micro-FEs or Module Federation. Team independence is the primary driver.
Key Insight
I have built the same product in three different architectures over a decade. The first version was a jQuery MPA. The second was a React SPA. The third is Next.js SSR/SSG hybrid. Each rewrite was necessary because the requirements outgrew the architecture — not because the earlier architecture was "wrong." The SPA version was excellent for the team size and feature set of 2018; it became a liability when SEO and performance became critical in 2022. Think of architecture as a moving target, not a one-time decision.
3 · Data Model & State Shape
Frontend architecture determines where state lives, how it flows, and when it is computed. Let's model the space taxonomically.
State categories
Server state: Data fetched from an API — user profile, product list, order history. The source of truth is the server; the client holds a cached copy. Every architecture must handle loading, error, and staleness for server state.
Client state: UI-local data — dropdown open/ closed, form input values, scroll position. SPAs manage this entirely on the client; MPAs reset it on every navigation.
URL state: Route params, query strings, hash fragments. The URL is a first-class state container in SPAs and SSR apps; MPAs already encode state in URLs by nature.
Persistent state: Data that survives page reloads — auth tokens, preferences, draft content. localStorage, sessionStorage, IndexedDB, or cookies depending on the needs.
In an MPA, most state lives on the server. The client holds only transient UI state that resets on navigation. In an SPA, the client holds everything — server state in a cache (React Query, SWR, RTK Query), client state in local stores (Zustand, Jotai, Redux), URL state in the router. SSR/SSG splits the difference: server renders from server state, client hydrates and takes over for subsequent navigations.
Type-level view
state-model.tstypescript
// Server state (shared across architectures)
interface User {
id: string;
name: string;
email: string;
avatar: string;
}
interface Product {
id: string;
title: string;
price: number;
description: string;
}
// Client state (architecture-specific)
interface UIState {
isCartOpen: boolean;
selectedVariant: string | null;
activeTab: "details" | "reviews" | "shipping";
}
// URL state (routing concern)
type RouteParams =
| { page: "home" }
| { page: "product"; slug: string }
| { page: "checkout"; step: number };
The architecture determines how these types map to storage. In an MPA, UIState is ephemeral — it resets on every navigation. In an SPA, it persists in memory across route changes. In SSR/SSG, it starts on the server (serialized into the HTML) and then transfers to the client.
4 · Interface Definition (API)
The architecture defines the interface between the frontend and the backend — the API contract. I distinguish three categories of APIs that an architecture must accommodate.
1. Data APIs (REST / GraphQL / tRPC)
The standard contract for fetching and mutating data. Every architecture — MPA, SPA, SSR — has a data API. The difference is when it is called. In SSG, data APIs are called at build time. In SSR, they are called at request time on the server. In SPA, they are called at runtime on the client.
SSR frameworks expose server-side rendering hooks. In Next.js, these are getServerSideProps (Pages Router) or async function Page() (App Router Server Components). These APIs run on the server at request time and inject data into the page before it reaches the client.
Micro-Frontends need an integration API — how the shell discovers and mounts child applications. Module Federation exposes exposes and remotes in Webpack config; the shell imports remotes as if they were local modules.
Figure 2 — Five rendering architectures compared across build time and runtime behavior. The trade-off is always between build cost and runtime flexibility.
5 · Component Deep Dive
Components are the building blocks of every architecture. But how you write them changes dramatically across paradigms.
MPA: Template-driven components
In an MPA, components are server-side templates — ERB, Haml, Pug, or JSX rendered on the server. They receive data as props from the controller and render HTML strings. There is no client-side lifecycle, no state, no effects. If you need interactivity, you add a sprinkle of vanilla JavaScript or jQuery.
The simplicity is deceptive. There is no hydration, no bundle splitting, no framework overhead. The component renders instantly because it is just HTML. The cost: every interaction requires a round trip to the server.
SPA: Lifecycle-driven components
In an SPA, components are client-side React/Vue/Svelte components with full lifecycle: mount, update, unmount, effects. The component fetches its own data, manages its own state, and renders into the DOM. It is a self-contained unit of interactivity.
The component is now a full application in miniature: it loads, renders, updates, and handles user input — all on the client. The trade-off is that every such component adds to the JavaScript bundle and increases the time to interactive.
SSR: Universal components
In SSR, the same component renders on the server and hydrates on the client. The component is universal — it can access server-only resources (databases, file system) through Server Components or data loaders.
universal-components.tsxtsx
// Server Component — runs on the server, zero JS sent to client
async function ProductCard({ slug }: { slug: string }) {
const product = await db.product.findUnique({ where: { slug } });
return (
<div className="product-card">
<img src={product.imageUrl} alt={product.title} />
<h3>{product.title}</h3>
<p>${product.price}</p>
<AddToCartButton product={product} />
</div>
);
}
// Client Component — hydrates on the client
"use client";
function AddToCartButton({ product }: { product: Product }) {
const [isAdded, setIsAdded] = useState(false);
return (
<button onClick={() => {
addToCart(product);
setIsAdded(true);
}}>
{isAdded ? "Added!" : "Add to Cart"}
</button>
);
}
The Server Component generates the initial HTML and streams it to the client. The Client Component (marked "use client") hydrates only the interactive parts. This is the Islands pattern, but integrated into a single framework — no separate Astro setup needed.
6 · Under the Hood
Let's trace what actually happens when a user visits a page under different architectures. I will use the same scenario — visiting a product page at /products/smartphone-x — and walk through the call stack for each architecture.
MPA walkthrough
The browser sends a GET request to the server. The server's router matches /products/:slug, the controller queries the database for "smartphone-x", renders an ERB template into HTML, and sends it back. The browser parses the HTML, builds the DOM, paints the page. No JavaScript framework involved.
mpa-trace.txttext
[Browser] ──GET /products/smartphone-x──→ [Server]
[Server] Router.match("/products/:slug")
[Server] ProductsController#show
[Server] @product = Product.find_by(slug: "smartphone-x")
[Server] render :show # ERB template → HTML string
[Server] ────── HTML (200 OK) ────→ [Browser]
[Browser] Parse HTML → DOM → CSSOM → Layout → Paint
[Browser] Execute any inline <script> tags
The call stack is shallow. The entire rendering happens on the server. The client is a thin display layer. This is why MPAs have excellent LCP — there is no JavaScript to download, parse, or execute before the content appears.
SPA walkthrough
The browser loads the HTML shell and the JavaScript bundle. React initializes, the router reads the current URL (/products/smartphone-x), renders the ProductPage component, which calls fetch("/api/products/smartphone-x") in a useEffect. The API response arrives, React re-renders with the product data, and the DOM updates.
Note the extra round trip for the API call. The HTML shell arrives quickly but contains no content. The real content requires JavaScript to download, parse, execute, and fetch data. This is the "waterfall" problem that SSR solves.
SSR walkthrough
The server receives the request, runs the Server Component directly, queries the database, renders the full HTML (including the product data), and streams it to the client. The HTML arrives with all content included. React hydrates the page on the client, attaching event handlers without re-rendering the content.
ssr-trace.txttext
[Browser] ──GET /products/smartphone-x──→ [Server]
[Server] Next.js router match → render Server Component
[Server] ProductPage(params.slug)
[Server] db.product.findUnique({slug: "smartphone-x"})
[Server] Render to HTML stream
[Server] ──── Full HTML with product data ──→ [Browser]
[Browser] Parse HTML → DOM → CSSOM → Layout → Paint
[Browser] Hydrate: React attach events, no re-render
[Browser] Subsequent navigation: client-side fetch (SPA mode)
The critical difference from the SPA trace: there is no API round trip from the browser. The data is fetched on the server and serialized directly into the HTML. First paint includes the product content. This is why SSR achieves better LCP than SPA for dynamic content.
Call stack comparison
Step
MPA
SPA
SSR
1. Navigation
Full page load
Client router intercepts
Server handles request
2. Data fetch
Server DB query
Client API call (waterfall)
Server DB query
3. Render
Server template
Client React render
Server React render
4. First paint
Immediate (full HTML)
After hydration + fetch
Immediate (full HTML)
5. Interactivity
Requires page reload
Instant after bootstrap
After hydration
6. Subsequent navs
Full page load each time
Instant client-side
Client-side (SPA-like)
Key Insight
The call stack table reveals the fundamental trade-off: MPA and SSR excel at first paint (steps 1-4), but MPA suffers on subsequent navigations (step 6). SPA has worse first paint but instant subsequent navigation. SSR combines both — at the cost of running React on the server, which adds server compute and operational complexity.
7 · Data Flow & Communication
Data flow varies dramatically by architecture. Let's trace a concrete interaction — the user adds a product to their cart — across the three primary models.
MPA data flow
User clicks 'Add to Cart'
Browser sends POST /cart with form data. Full page navigation.
Browser tears down current page, parses new HTML, repaints. All previous JS state is lost.
SPA data flow
User clicks 'Add to Cart'
JavaScript event handler fires. No navigation — the handler runs in the current page context.
Optimistic UI update
The cart count updates immediately in the UI. The mutation is also sent to the server asynchronously.
Background API call
fetch(POST /api/cart) runs in the background. The user can continue browsing — no page transition.
Response updates cache
The server response updates the local cache (React Query/SWR/RTK). UI re-renders if the server returned different data.
SSR data flow (post-hydration)
User clicks 'Add to Cart'
Same as SPA — after hydration, the app runs client-side. JavaScript handler fires, no navigation.
Server Action (optional)
In Next.js, the handler can call a Server Action — a function that runs on the server but is invoked from the client. No manual API route needed.
Cache invalidation
The server action can revalidate cached data (revalidatePath, revalidateTag), triggering fresh data on the next render.
Figure 4 — The universal data flow pipeline. CSR runs all stages on the client; SSR/SSG offload the state → render step to a server at build or request time.
The SSR data flow after hydration is nearly identical to the SPA flow — the fetch call goes to the same API endpoint. The difference is the Server Action pattern, which eliminates the need for a separate API route: the mutation function runs directly on the server, with full access to the database, without exposing an HTTP endpoint.
8 · Performance Optimization
Performance is the primary reason teams migrate between architectures. Here are the critical optimizations per architecture.
MPA optimizations
Turbo / Hotwire (Rails): Intercept link clicks and form submissions via AJAX, replace the page body without a full reload. This is the "SPA-like" enhancement for MPAs — it bridges the gap without a full framework migration.
HTTP caching: Set aggressive Cache-Control headers on static assets. Since MPAs load new HTML for each page, CDN caching is essential. Use ETags for conditional requests.
Critical CSS: Inline above-the-fold CSS in the document <head> and defer the rest. This eliminates render-blocking CSS requests.
SPA optimizations
Code splitting: Use dynamic import() to split the bundle by route. Each page loads only its own JavaScript. React.lazy + Suspense makes this ergonomic.
Bundle analysis: Regularly run npx vite-bundle-analyzer or webpack-bundle-analyzer to catch accidental large imports. Moment.js, lodash, and icon libraries are common culprits.
Preload / prefetch: Use <link rel=preload> for critical resources and <link rel=prefetch> for likely-next pages. Frameworks like Next.js auto-prefetch pages in the viewport.
Virtual scrolling: For long lists, use react-window or @tanstack/virtual to render only visible rows. This is crucial for dashboards and feeds.
SSR / SSG optimizations
Streaming SSR: Render HTML in chunks and stream it to the client. The browser can start painting before the full response is received. React 18's renderToPipeableStream enables this.
Selective hydration: Hydrate interactive components eagerly, defer static ones. React 18's selective hydration wraps components in <Suspense> — static parts are skipped during hydration, reducing TTI.
ISR (Incremental Static Regeneration):Pre-render pages at build time, then revalidate specific pages on demand after a TTL. This gives SSG-level LCP with dynamic freshness. Next.js supports this natively.
Edge rendering: Run SSR at the edge (Cloudflare Workers, Vercel Edge) to reduce network latency. The server renders close to the user, not in a single data center.
Tradeoff table
Metric
MPA
SPA
SSG
SSR
LCP
✅ Excellent
❌ Poor (JS waterfall)
✅ Excellent
✅ Good (streaming)
TTI
✅ Immediate
❌ Poor (JS exec)
✅ Good
⚠️ After hydration
Subsequent nav
❌ Full reload
✅ Instant
✅ Instant (pre-built)
✅ SPA-like after hydrate
SEO
✅ Excellent
❌ Needs prerender
✅ Excellent
✅ Good
Server cost
⚠️ Per-request compute
✅ Cheap (CDN)
✅ Cheap (CDN)
⚠️ Per-request compute
9 · Security Considerations
Architecture choices have security implications that are often overlooked during the design phase.
CSRF in MPAs
MPAs rely on cookie-based authentication. Every form submission sends the cookie automatically, making CSRF (Cross-Site Request Forgery) a primary threat. The solution is a CSRF token embedded in each form, validated by the server. Rails and Django include this by default; custom MPA implementations often forget it.
XSS in SPAs
SPAs render user-generated content on the client. React's JSX escaping handles most XSS vectors, but dangerouslySetInnerHTML and third-party scripts that read from localStorage are common attack surfaces. In SSR, XSS is doubly dangerous: an injection renders into the initial HTML and persists in the cached response.
API token exposure in SPAs
SPAs store API tokens in memory, localStorage, or cookies. localStorage is accessible to any JavaScript running on the same origin — a single XSS vulnerability leaks every token. HttpOnly cookies are safer because the browser prevents JavaScript access. But cookies need CSRF protection, creating a circular dependency. The industry consensus (as of 2026) is: use HttpOnly cookies withSameSite=Strict for auth, and keep API tokens in memory only.
Server exposure in SSR
In SSR, the server executes application code. A Server Component that accidentally imports a client-only module will crash at render time. More importantly, Server Components have direct database access — a compromised build pipeline could expose the entire database. Use parameterized queries in Server Components and never concatenate user input into SQL strings. This is the same rule as any backend, but it is easy to forget when writing what looks like React components.
Micro-FE attack surface
Micro-Frontends amplify the security surface because each child application is a separate attack vector. If one app is compromised, it can access the shell's origin — including cookies, localStorage, and postMessage listeners. Isolate Micro-FEs with subdomains (app1.example.com, app2.example.com) and use postMessage with origin validation rather than same-origin composition.
Warning
Module Federation shares the same JavaScript runtime. A compromised remote can access the shell's global scope — modifying React, hijacking fetch, reading all state. If security is a top concern, use iframes with sandbox attributes rather than Module Federation. The UX cost (slower communication, frame boundaries) is worth the isolation guarantee.
10 · Testing Strategy
Testing strategy must adapt to the architecture. What you test and how you test it changes when rendering moves from server to client to build time.
MPA testing
Controller tests: Test that the server returns correct HTML status codes, redirects, and template variables. RSpec (Rails), pytest-django, and PHPUnit cover this well.
Integration tests: Use Capybara or Playwright to test full user flows — navigate to a page, submit a form, assert the response.
View tests: Test template rendering with different data inputs. In Rails, view specs validate the HTML output against fixture data.
SPA testing
Component tests: React Testing Library with@testing-library/user-event. Test behavior — render a component, simulate user interaction, assert on what appears in the DOM.
Hook tests: Custom hooks (data fetching, debounce, local storage) are tested with renderHook from React Hooks Testing Library.
E2E tests: Playwright or Cypress for critical user journeys — login, search, purchase. These tests run against the full stack (client + API + database).
Visual regression: Chromatic or Percy for UI snapshot testing. Useful for catching unintended CSS changes in complex SPAs.
SSR / SSG testing
Server Component tests: Test Server Components with renderToString or a test utility that runs them in a Node environment. Assert on the HTML output, including data fetched from the database.
Data loader tests: Test getServerSideProps or page loaders in isolation — mock the database, assert the returned props.
Hydration mismatch tests: Render a page on the server and on the client with the same data, then diff the output. Hydration mismatches are a leading cause of SSR bugs. Next.js supports strict-mode to catch these in dev.
ssr-component.test.tsxtypescript
// Server Component test (Vitest + React)
import { renderToString } from "react-dom/server";
import { ProductPage } from "./ProductPage";
// Mock the database call
vi.mock("../../lib/db", () => ({
db: {
product: {
findUnique: vi.fn().mockResolvedValue({
id: "1",
title: "Smartphone X",
price: 799,
imageUrl: "/images/phone.jpg",
}),
},
},
}));
test("renders product title in SSR", async () => {
const Component = await ProductPage({ params: { slug: "smartphone-x" } });
const html = renderToString(Component);
expect(html).toContain("Smartphone X");
expect(html).toContain("799");
});
Note
For Micro-Frontends, add contract tests (Pact) to verify that the shell's integration contract with each micro-app remains stable. A micro-app changing its exposed API without updating the contract will silently break the shell at runtime.
11 · Accessibility
Accessibility responsibilities shift between server and client depending on the architecture.
Server-rendered HTML (MPA / SSG)
In MPAs and SSG, the HTML is generated entirely on the server. ARIA attributes, semantic HTML, heading hierarchy, and focus management must be correct at render time — there is no JavaScript to fix them after the fact. The advantage is that the HTML is visible to assistive technology immediately, without waiting for JavaScript to load.
SPAs must manage focus manually — when a route changes, the router should focus the new page's heading. Without this, keyboard users are left at the top of the page with no indication that content changed. React's useEffect with a ref on the main heading is the standard solution.
useFocusOnNavigate.tstypescript
// SPA focus management on route change
function useFocusOnNavigate(pathname: string) {
const headingRef = useRef<HTMLHeadingElement>(null);
useEffect(() => {
if (headingRef.current) {
headingRef.current.focus();
// Announce to screen readers
const announcer = document.getElementById("route-announcer");
if (announcer) {
announcer.textContent = `Navigated to ${pathname}`;
}
}
}, [pathname]);
return headingRef;
}
SSR / Hydration challenges
SSR has a unique a11y challenge: the server-rendered HTML is accessible immediately, but during hydration, the DOM may shift as React reconciles the tree. This can cause focus to jump unexpectedly for screen reader users. The solution is to ensure the server HTML and the client HTML are identical on first render — no hydration mismatches. Use suppressHydrationWarning only as a last resort, and never on interactive elements.
Key Insight
Architecturally, SSG is the most accessible-friendly pattern: the HTML is fully-formed, semantic, and immediately available. No JavaScript is required for the initial experience. Interactive elements can be progressively enhanced. This is why the UK GOV.UK and other government sites use server-rendered HTML — accessibility is not optional when you serve the entire population.
12 · Live Demo
The best way to understand architectures is to experience the difference yourself. Open the browser DevTools Network tab and visit these pages:
MPA experience: Visit Wikipedia and click a few articles. Watch the Network tab — every click is a full HTML document load.
SPA experience: Visit diagrams.net or Figma. The initial load takes time, but after that, navigating between screens is instant.
SSR experience: Visit nextjs.org or Vercel Blog. The HTML arrives with content, then JavaScript hydrates the page.
Figure 3 — Three composition strategies: Atomic Design builds a hierarchy of reusable primitives; Compound Components share implicit state via context; Micro-Frontends isolate entire apps at deploy time.
The diagram above shows the three dominant component composition patterns. Each maps to different architectural preferences: Atomic Design is framework-agnostic (works in MPA, SPA, SSR), Compound Components are a React/SPA pattern, and Micro-Frontends are the composition strategy for multi-team products.
13 · Key Takeaways
Architecture is a trade-off, not a religion. The best architecture depends on your team size, performance requirements, and content dynamics. SSG is not "better" than SPA — it is better for some things and worse for others. Engineers who religiously advocate for one architecture have usually only shipped one type of product.
The rendering strategy is the central decision. When is HTML produced — at build time (SSG), at request time (SSR), or on the client (SPA)? Everything else — data fetching, routing, state management, deployment — follows from this choice.
Start simple, evolve deliberately. Reach for Next.js or Astro (SSR/SSG hybrid) as the default in 2026. It gives you the MPA-like initial load performance and the SPA-like subsequent navigation. You can progressively add client-side state, streaming, and islands as needed. Do not start with Micro-Frontends unless you have multiple teams ready to deploy independently.
Hydration is not free. SSR without selective hydration still sends JavaScript for the entire page. The hydration tax — downloading, parsing, and executing component code that could have remained static — is why Islands and Server Components exist. If your page is mostly static with a few interactive widgets, Islands (Astro) or Server Components with Client sub-trees (Next.js) are the optimal pattern.
Measure before migrating. "Our site is slow" is not a reason to rewrite in a different architecture. Profile first. The bottleneck might be oversized images, unoptimized API calls, or render-blocking CSS — all fixable in any architecture. Rewriting the architecture changes everything and introduces new bugs. Measure, identify the bottleneck, and fix it in the current architecture before considering a rewrite.
Architecture decisions compound over time. A poorly-chosen architecture costs more in developer productivity than in runtime performance. The MPA that forces two-second full-page navigations is tolerable for a docs site. The SPA that takes eight seconds to load is a business disaster for an e-commerce site. The SSR app that costs $5,000/month in server compute should have been SSG. Pick the architecture that optimizes for the metrics your business cares about.
Frontend architecture is a moving target. What I reach for today — SSR/SSG hybrid with selective hydration and Server Components — will likely look different in five years. The principles that endure are not about specific frameworks: they are about understanding where the rendering happens, when the data is fetched, and how the user perceives the trade-off between initial load and subsequent interaction.
I have rewritten the same application in three architectures over a decade. Each version was the right choice at the time. The architecture that ships is better than the architecture that is perfect. Build something, measure it, learn from it, and iterate.