This section looks at the whole application: how it's divided among teams, and whether it's built and released as one unit or many. These approaches make different choices about ownership, coordination and what ships together, not stages every frontend must pass through.
These boundary choices are not exclusive to the frontend, backend systems face similar choices: one large application or smaller, independently deployed services (microservices). Micro-frontends apply a related idea, with their own integration costs. For an online store, the question is how search, checkout and shared navigation can change while still feeling like one product to the user.
The monolith and its limits
One application, built and deployed as one unit. It's simple, fast to start, and underrated. Overlapping changes can create merge conflicts, slow builds and one team's bug blocking another team's release, but these problems are not inevitable consequences of team size.
Modular Monolith and Monorepo
- 1. Module boundaries
Define responsibilities, public interfaces and allowed dependencies.
- 2. Build & packaging
Bundle or link modules into one deployable frontend application. Separate package builds or output files still ship as one release.
- 3. Runtime composition
At runtime, modules run together in the browser. They can communicate through in-memory calls and share state.
- Modular monolith: defines boundaries within one application and keeps its release together. Common example: feature folders with ESLint import rules and shared TypeScript interfaces, built directly as part of the application. Modules can also live in separate workspace packages.
- Monorepo workspaces: by contrast, organize source code within one repository. Module boundaries can use packages with declared dependencies and public exports, commonly using npm workspaces and package manifests. Packages may have their own build steps. A monorepo is not limited to one application and does not determine how modules are composed at runtime.
Micro-Frontends
Micro-frontends divide a frontend into independently owned parts that are integrated into a larger user experience. They can support separate releases, but that independence depends on how the parts interact, not just how their code is divided.
- Why companies adopt them: team autonomy, independent releases, and gradually replacing a legacy application.
- How they're stitched together: each micro-frontend is typically built and deployed separately, then integrated into a shared page or connected through navigation. Dependencies may be bundled with each part. Micro-frontends running in the same JavaScript context can also share dependencies at runtime, requiring agreement on compatible versions and loading. Iframe-based parts normally load their dependencies separately.
- The costs: duplicate dependencies will increase the code users download and run. Sometimes dependencies cannot be shared, so multiple versions of the same dependency are used across different micro-frontends. Where teams do share dependencies, they must actively coordinate compatible versions and upgrades to avoid bloat. Other risks include inconsistent user experience, harder cross-boundary debugging and coordination overhead. A shared component library can help with UI consistency, but does not coordinate releases on its own.
Shared navigation and session behavior need contracts: agreements about URLs, sign-in/sign-out changes and how parts communicate. For example, when the header signs a user out, checkout needs to learn about that change and clear its user-specific state. The teams must agree how that update is communicated and keep the contract compatible across independent releases. Integration checks and a plan for a part that fails to load are also needed.
Trade-offs
| Architecture | What you gain | What it costs | Best fit |
|---|---|---|---|
| Monolith | One build and deployment path; easier to connect changes across features | Overlapping changes need coordination; one bug can block the shared release | Features that benefit from changing and releasing together |
| Modular monolith | Clear ownership by business area; fewer accidental breakages; still one deployment unit | Boundaries need discipline and checks; teams still release together | A product needing clearer feature boundaries without separate releases |
| Micro-frontends | Can support independent releases or piece-by-piece legacy migration | Duplicated code and inconsistent UX risks; harder integration/debugging; release-contract maintenance | A demonstrated need for separate releases or migration that justifies integration costs |
Check your understanding
Quiz
Checkout changes keep breaking search. What boundary addresses that problem?
Search reads checkout's internal cart state to display an 'already in cart' badge. Checkout changes that state's structure, and search results stop rendering because search still expects the old fields. Both teams are happy with a common release. Which change most directly prevents this kind of accidental breakage?
Review questions and explanations (text alternative)
-
Checkout changes keep breaking search. What boundary addresses that problem?
Search reads checkout's internal cart state to display an 'already in cart' badge. Checkout changes that state's structure, and search results stop rendering because search still expects the old fields. Both teams are happy with a common release. Which change most directly prevents this kind of accidental breakage?
- Expose an item-in-cart interface and restrict search to checkout's public API.
- Use independent release pipelines so each team chooses its deployment schedule.
- Document the existing dependency in workspace package manifests.
- Require search-team approval for changes to checkout's private data structure.
Suggested answer: Expose an item-in-cart interface and restrict search to checkout's public API.
An item-in-cart interface lets search get what it needs without depending on checkout's internal state structure, and import rules prevent bypassing it. Separate releases could introduce a communication contract, but add deployment and compatibility overhead when both teams are happy with a common release. Dependency declarations document the coupling, and extra reviews coordinate changes rather than remove it.
-
Which finding most weakens the case for independent deployments?
Account fixes regularly wait several days for checkout's release approval. The features already have clear interfaces, and the teams are considering independent deployments. Which finding would most weaken the case for splitting them?
- Source code and build tooling live in a single repository.
- The teams have standardized on one UI framework and design system.
- Users see the features together under shared page navigation.
- Most account fixes require an incompatible checkout update in the same release.
Suggested answer: Most account fixes require an incompatible checkout update in the same release.
Shared repositories, tools, frameworks and pages do not by themselves prevent independent delivery. Separate deployments offer less benefit when most changes still require coordinated updates across the boundary.
-
What evidence would justify evaluating separate deployments?
Search wants weekly releases while checkout prefers a monthly schedule. Both still ship together. The teams propose micro-frontends, but have little capacity to maintain integration tooling. Before committing to the split, which investigation would best establish whether the benefits justify the costs?
- Measure release blocking, trial separate deployments, and track compatibility and recovery costs.
- Benchmark compilation and test whether workspace caching would remove the biggest build bottleneck.
- Approve the split if expected delay savings exceed the one-time pipeline setup estimate.
- Survey preferred shipping dates and choose the arrangement favored by the most number of team members.
Suggested answer: Measure release blocking, trial separate deployments, and track compatibility and recovery costs.
Independent delivery is worthwhile only if reduced release blocking outweighs recurring compatibility and recovery work. Preferred schedules, faster builds and one-time setup estimates do not establish whether the split is worth operating.
-
Which contract addresses a sign-out inconsistency?
A store now loads independently released navigation and checkout into the same browser page. Signing out in navigation clears its user display, but checkout keeps showing the previous user's saved address until the page is refreshed. Which agreement most directly addresses this user-visible inconsistency?
- Specify sign-out propagation, state clearing and version checks.
- Standardize the TypeScript user-data fields consumed by each feature.
- Adopt one account-display component for consistent signed-out presentation.
- Require each team to pass isolated tests of its own session implementation.
Suggested answer: Specify sign-out propagation, state clearing and version checks.
Both parts must learn about sign-out and clear user-specific state, with cross-version checks keeping that contract reliable. Sharing types or display code alone does not establish that runtime contract; isolated tests miss cross-part failures.