Case Study
From a Monolithic Frontend to Next.js Multi-Zone Architecture (From Monolithic Frontend To Nextjs Multi Zone)
Why do monolithic frontend boundaries become strained in a growing marketplace? A decision record covering the alternatives, trade-offs, and production…
Production Engineering Notes — Client Architecture
Part 1 of 10
Reference note
This series shares decisions and design approaches derived from engineering experience in real production systems. It includes no non-public source code, customer data, infrastructure configuration, or internal operational information. Examples are generalised or anonymised to honour confidentiality obligations.
The starting problem
A monolithic frontend is not a bad start. With one team, one delivery rhythm, and a limited product surface, it has the lowest operational cost. Tension starts when catalogue, search, cart, checkout, account, and merchant experiences change at different speeds.
One frontend
→ one build queue
→ one release window
→ unrelated changes waiting for each other
The question is not how to build Multi-Zone. It is which evidence makes a frontend boundary worth more than the complexity it adds.
Concepts at first use
📦 Zone
An independently deployable client application responsible for a defined URL area and user intent.
📦 Gateway
The entry layer behind one public domain that forwards a request to the right zone.
📦 Independent deployment
Shipping a domain change without binding it to an unrelated release window.
📦 Blast radius
The users and system surface a failure or change can affect.
A zone does not merely split folders. It splits ownership, deployment, observability, and rollback decisions too.
Why a monolith eventually slows down
In a marketplace, search changes its filtering and indexing behaviour often. Cart and checkout need higher confidence and a more controlled release process. Merchant tools should evolve independently from the buyer journey. Keeping them in one deployment unit creates shared coordination rather than useful code sharing.
The alternatives
| Alternative | Strength | Accepted cost |
|---|---|---|
| One application | Lowest local complexity | Shared release window and growing blast radius |
| Module Federation | Runtime module composition | Version, runtime dependency, and debugging cost |
| Next.js Multi-Zone | Independent deployment by URL domain | Routing, asset, and cross-zone contract discipline |
| Separate public domains | Strong isolation | Fragmented session, UX, and SEO |
Multi-Zone is useful when independent change and one coherent user surface are both required. The browser sees one product; teams see owned client domains.
The decision: align URL boundaries with business boundaries
Each zone owns a URL area, its user intent, and release responsibility. The gateway preserves one product surface while routing requests to that ownership boundary. Route ownership must be declared in one place. Otherwise two zones claim the same path, locale handling drifts, and redirects grow unnoticed.
Browser → Gateway
→ Catalogue zone
→ Search zone
→ Cart and checkout zone
→ Account zone
The trade-off
Independent deployment is not free. Every zone adds build, deploy, health, rollback, security, and ownership cost. Cross-zone state requires an explicit authority and contract rather than a global client store that silently becomes another monolith.
Production lessons
- Assets need isolated prefixes and cache policy.
- Gateway routing must preserve dynamic paths and locales.
- Session refresh and logout need cross-zone tests.
- Independent deployment also requires independent rollback.
- Correlation IDs and route-level metrics make a user journey observable across zones.
What I would change today
I would not create zones earlier. I would first prove route ownership, team independence, and measurable release friction. Shared UI, auth, types, and utilities would remain narrow and versionable. A shared package that becomes an unbounded common area recreates the monolith.
The first target would be the lowest coordination cost, not the highest number of zones.
Common confusions
❌ Multi-Zone means one app per page
✓ A zone is a boundary of independently changing user intent and ownership.
❌ Multi-Zone guarantees micro frontend success
✓ Route, asset, session, and rollback contracts must be designed.
❌ Shared package means centralise everything
✓ It is for stable, truly shared contracts.
Decision checklist
- Does the area have a genuinely different user intent, owner, and release rhythm?
- Does the boundary reduce blast radius?
- Are route, locale, and asset ownership explicit?
- Is the authority for session and cross-zone state clear?
- Does each zone have health, rollback, and observability signals?
- Is its cost against Module Federation or a modular monolith written down?
A boundary is valuable only when it reduces testing, incident, and decision cost as well as deployment time.
What should remain with you
Multi-Zone does not exist to fragment a frontend. It exists to contain the effect of change within the right boundary.
A monolith can remain the right choice for a long time. Separation becomes useful only when independent change, fault isolation, and controlled delivery are all proven needs.
Next: Why Not Module Federation?
FAQ
Frequently asked questions
What is Zone?
An independently deployable client application responsible for a defined URL area and user intent.
What is Gateway?
The entry layer behind one public domain that forwards a request to the right zone.
Is it true that "Multi-Zone means one app per page"?
A zone is a boundary of independently changing user intent and ownership.
What does this part lock in?
The question is not how to build Multi-Zone. It is which evidence makes a frontend boundary worth more than the complexity it adds. > This series shares decisions and design approaches derived from engineering experience in real production systems. It includes no non-public source code, customer data, infrastructure configuration, or internal operational information. Examples are generalised or anonymised to honour confidentiality obligations.
Engineering Principles Learned
- A frontend boundary starts with URL, user intent, and ownership—not folders.
- Independent deployment depends on explicit route and contract discipline.
- The best separation produces the lowest coordination and failure cost, not the most zones.
PRODUCTION REFERENCE
Decision record and production validation
DECISION SIGNALS
- Release coordination was increasing.
- Business domains had diverged in their rate of change.
- A failure in one area could affect the whole product surface.
- URL boundaries offered a natural ownership model.
PRODUCTION VALIDATION
- Marketplace platform
- Technical leadership
- B2B/B2C
- Multi-tenant
- Independent deployment
- AWS
- React
- Next.js
EVIDENCE: CASE STUDY
Kayra Export Marketplace Platform
The anonymised architectural context and production impact of this decision are available in the related case study.
Explore the architectural context →Continue reading
Continue reading
Related articles
How Does a CQRS (Command Query Responsibility Segregation) Pipeline Work? Anatomy of Command and Query Flows
What is a CQRS request pipeline? How does an HTTP request travel through Controller, MediatR, pipeline behaviors, a handler, Outbox, and a read model?
Related articles
From Layers to Features: Why Did Vertical Slice Emerge?
Why does layered architecture slow change as a system grows? An architectural guide to Vertical Slice as a decision about feature ownership, behaviour…
Related articles
DDD in Production: Distributed Systems and Modernization Strategies
How does DDD survive production change? A guide to Event Storming, Saga, Transactional Outbox, Anti-Corruption Layers, and Strangler Fig modernization.