Architecture decisions
What you need to know
An architecture decision record (ADR) explains a choice, its alternatives, assumptions and consequences. Select the simplest Next.js architecture that satisfies ownership, delivery and operational requirements.
By the end, you can: compare modular monolith and multi-zone; write an ADR.
A sample decision record
{ "context": "two teams, one release train", "decision": "modular monolith", "alternatives": [ "BFF with separate API", "multi-zone" ], "consequences": [ "shared deploy", "simpler routing" ], "revisit": "independent release requirements or measured build bottleneck"}Expected behavior: This is an evidence-led default for the given assumptions, not a universal rule.
How it works
A modular monolith can provide public pages and authenticated dashboards from one deployment while keeping features distinct. A backend-for-frontend can adapt independent service APIs to a specific UI, but adds network failures and authorization boundaries. Multi-zone architecture splits URL ownership across separately built applications on a domain. A zone needs non-overlapping route ownership, asset namespace coordination, explicit proxy/routing rules and compatible authentication; cross-zone navigation normally needs a document navigation rather than assuming a shared client router. The 15.x multi-zone documentation is a historical reference here: verify the exact 16.x behavior and asset prefix requirements before deployment. basePath changes the URL base of an application; an asset prefix addresses delivery of framework assets and is not an access policy. Different teams do not automatically require separate deployments. Record the evidence that would justify a split: independently released features, isolated failure domains or a measured build bottleneck. Track the costs of shared sessions, duplicate assets, tracing and incident ownership. Establish a reversible migration plan before moving a path.
Proposed ownership map for a future split
/catalog/* -> catalog zone/learn/* -> learning zone/api/* -> explicitly assigned ownerstatic assets -> unique reviewed prefixesExpected behavior: The ingress must resolve every owned path consistently; test direct loads, cross-zone links, auth cookies and versioned assets.
Common mistake
Do not call a folder structure microservices or assume multiple zones share React state across a document navigation. Independent builds increase compatibility obligations.
Practice and verification
Write an ADR for one fictional team that releases weekly and another that requires independent emergency releases. Compare downtime, route ownership, common authentication and rollback for both alternatives.
Scope: Proposed Next.js 16.x / React 19; App Router, Cache Components disabled unless noted. Framework and browser examples are staged, not executed. No exact patched dependency release or live deployment verified.