Skip to content

    Frontend System Design

    Front-End Case Study: Enterprise Micro-Frontend Platform

    Design an enterprise micro-frontend platform: composition options, shared dependencies, versioning, failure isolation and rollback, with a runnable lab.

    By Published 23 min read

    • frontend-system-design
    • case-study
    • micro-frontends
    • platform
    Share

    What you'll learn: By the end of this case study you will be able to design the shell side of an enterprise micro-frontend platform: choose a composition option for each slot instead of one for the whole page, decide which packages are shared and which are duplicated, write the contract between the shell and a team's build, version builds so a bad release can be undone, and keep one failing slot from taking the page, or the on-call engineer, down.

    Think of a shopping mall. Every shop has its own staff, stock, till and opening hours. The mall supplies the shared things: power, fire doors, signs and the lease that says what a shop may and may not do. When one till blows a fuse, a good mall has the circuit break in that shop only, and the other shops keep trading. A micro-frontend platform is that mall: independent shops, a landlord with a contract, and a circuit breaker per shop.

    This is an educational reference design, not the verified internal architecture of any company. It is a generic enterprise portal; the team names, package versions and every number are illustrative, and the lab at the end is a model with no bundler and no network.

    The method follows the case-study method lesson. The ideas used here are taught one by one in Micro-Frontend Composition Approaches, Module Federation in React and Failure Isolation and Observability in Micro-Frontends; this lesson joins them into one design. The enterprise SaaS dashboard and multi-tenant application case studies are planned and not yet published.

    The core idea

    1. A platform is a contract, not a framework. The shell promises a mount point, a set of shared packages, a session and a place to report errors. A team promises a build that mounts into a slot, declares the version it is and the shared packages it needs, and fails safely. Everything else is the team's choice.
    2. Composition is chosen per slot. A slot with a hard isolation need, a slot that must be in the first HTML and a slot that three teams release daily do not want the same mechanism.
    3. Failure isolation and rollback are platform features. A slot always has a fallback, a version it can go back to, and a way to be switched off. Teams do not each reinvent them.

    Three illustrations run through the lesson: a minimal example (one slot loads one build), a realistic example (an operations portal with an orders area, a billing area and a reports area, each owned by a different team) and a failure example (a team ships a build that needs a React major version the shell does not provide).

    Requirements and scope

    Functional. One portal with common chrome (header, navigation, session) and areas owned by different teams. Each team builds, tests and releases its area on its own schedule. A new team can add an area without a change to the shell's code. Areas can be switched off, and rolled back, without a rebuild of anything else.

    Non-functional. One broken area must not break another area or the chrome. A release must not require other teams to release. A large library must not be downloaded several times. A failure must be traceable to a team and a version. The portal must stay usable by keyboard and screen reader whichever team built the area.

    Out of scope here. Authentication and the shared session (see Micro-Frontend Auth and Shared Session), the design system and its release process (see Design System Governance and Versioning), migrating a monolith step by step (see Micro-Frontend Anti-Patterns and Migration), server-side rendering of slots, and whether to use micro-frontends at all, which is about team structure first (Micro-Frontends and Conway's Law, Monolith vs Micro-Frontends). The decision is assumed; the lesson asks how to run the result.

    Illustrative sizing

    The numbers below are assumptions for reasoning, not measurements.

    Quantity Assumed value Why it matters
    Teams that own an area 9 Nine pipelines can change the page without talking to each other
    Slots on the busiest page 4 Each is a separate load, a separate failure and a separate boundary
    Releases per team per week 5 About 45 manifest changes a week: the check must be automatic
    Shared singleton packages 2 (React and React DOM) More than one copy of either breaks hooks
    Shared non-singleton packages 2 (a design system and a date library) A mismatch costs bytes, not correctness
    Share of releases that need a rollback 2 in 100 One rollback a day across the platform: it must be a button, not a project

    The hard problem is not rendering but change control: many small releases, one page, no human in the loop for each.

    The architecture: a shell, a manifest and a gate

    Figure 1. The platform from a team's release to a user's slot

    Micro-frontend platform: a registration gate guards the manifest, and the shell loads builds into slots with a fallbackTeam pipeline to Gate (candidate build); Gate to Manifest (accepted); Team pipeline to Static host (upload); Shell to Manifest (read); Static host to Shell (load files); Shell to Slot fallback (on failure)BEFORE RELEASE: RULES CHECKED BY MACHINEIN THE BROWSERTeam pipeline: build, publishTeam pipelinebuild, publishGate: contract, versionsGatecontract,versionsManifest: current, previousManifestcurrent, previousStatic host: immutable filesStatic hostimmutable filesShell: chrome, slotsShellchrome, slotsSlot fallback: retry, previousSlot fallbackretry, previouscandidate buildaccepteduploadreadload fileson failure

    How to read this: a team's pipeline uploads files to a static host and, separately, asks the gate to accept the build into the manifest. Only an accepted build is ever offered to a browser. The shell reads the manifest, loads the files of each slot's current build, and falls back to a retry, then to the previous build, when a load or a render fails.

    Two things change at different speeds. Files are produced by nine teams many times a week; which build is current is a small piece of data. Keeping them apart makes a release a pointer change after a check, and a rollback the same pointer moved back. single-spa's guidance has the same two steps: upload the static bundles, then update the import map to point to the new files, and write new files instead of overwriting old ones. A platform that overwrites files in place has no previous version to return to.

    Composition options, per slot

    The composition lesson compares the mechanisms in detail. For a platform the useful question is which to allow, and when. A short decision guide:

    Figure 2. Choosing a composition mechanism for one slot

    flowchart TD accTitle: Choosing a composition mechanism for one slot accDescr: Start with the slot. If it needs its own document for hard isolation, for example different frameworks or less trusted code, use an iframe. If its content must be in the first server response, compose on the server or at the edge. If the teams release independently and share a framework, load builds at run time through a manifest. If the teams release together anyway, publish packages and compose at build time. A[A slot on the page] --> B{Needs its own document: hard isolation, other frameworks, less trusted code?} B -->|yes| C[iframe, communicate by messages] B -->|no| D{Must be in the first HTML response?} D -->|yes| E[Compose on the server or at the edge] D -->|no| F{Teams release independently and share a framework?} F -->|yes| G[Run-time module loading through a manifest] F -->|no| H[Packages composed at build time]

    How to read this: the questions are ordered from the hardest constraint to the softest. Most slots of an enterprise portal end at the fourth question, which is why the rest of this lesson is about run-time loading, but a platform that forbids the other three will meet a slot that needs one of them.

    Three statements from the sources set the ground:

    • Cam Jackson's article on martinfowler.com defines micro-frontends as an architectural style where independently deliverable front-end applications are composed into a greater whole. Its benefits are incremental upgrades, simpler decoupled code bases, independent deployment and autonomous teams; its costs are duplicated dependencies in independently built bundles and more to manage, including repositories, pipelines and servers.
    • An iframe, in MDN's words, is a nested browsing context that embeds another document into the current one: the strongest isolation on the list, and the one that needs the most plumbing for navigation, sizing and communication.
    • single-spa sorts what it composes into applications (components for a set of routes), parcels (components without controlling routes) and utility modules (shared logic, no rendering). An application must provide bootstrap, mount and unmount functions, and single-spa decides when to mount from an activity function.

    A contract written as mount into a node you are given, update, unmount works for a federated module, a custom element and an iframe wrapper alike, and it is what the lab's "contract" number stands for.

    Mechanism Isolation of failure Independent release Shared libraries Costs the platform pays
    Packages at build time Weak: one bundle No: one release train Natural Every team waits for every other
    Server or edge composition Per fragment, if the assembler has fallbacks Yes None in the browser An assembler to run and cache
    Run-time modules Needs boundaries and fallbacks Yes Must be arranged A manifest, a gate, version rules
    Custom elements Medium: encapsulated styles, shared page Yes Each element brings its own A contract on attributes and events
    iframe Strong Yes None: each document loads its own Routing, sizing, messaging

    The table is this lesson's judgement, not a measurement.

    Shared dependencies

    The expensive mistake in a platform is to decide "everything is shared" or "nothing is shared". The sources say why neither works. Fowler's article warns that independently built bundles can duplicate dependencies, so users download the same libraries several times, and that sharing them from outside the bundles brings back build-time coupling. single-spa's recommended setup says it is crucial that a web app loads large libraries only once, and also that not everything should be shared, because shared dependencies have to be upgraded together by every micro-frontend that uses them; small libraries can be duplicated.

    So the platform sorts packages into three classes.

    Class Example (illustrative) Rule
    Singleton React, React DOM One copy per page. A build that cannot use the host's version is refused
    Shared, may duplicate A design system, a date library Reuse the host copy when the range fits; otherwise the build brings its own, and the platform counts the extra bytes
    Private Everything else Bundled into the remote; invisible to the platform

    Why React is a singleton: React's documentation for the invalid hook call warning lists "more than one copy of React in the same app" as a cause, explaining that the react import in application code must resolve to the same module as the react import inside react-dom. Two copies are not a small slowdown; they are a broken page.

    What Module Federation says

    Module Federation's shared option has the knobs the classes need. Its documentation says singleton allows only one version of a shared module in the share scope, that a higher version is loaded when versions are inconsistent, and that the lower-version party gets a warning; requiredVersion is the version or range a party needs; eager loads the shared module immediately, which the page warns can make the entry file large. The page describes warnings, not refusals. Refusing is a platform decision, made below.

    What import maps say

    single-spa's recommended setup describes a second way to share: in-browser modules and an import map, a browser specification for aliasing import specifiers to a URL, which its core team prefers while having no objection to Module Federation. MDN says an import map is a JSON object that controls how the browser resolves module specifiers, must be declared before any script that imports through it, and that when several maps are registered they are merged into one global map in which an already-mapped specifier keeps its first mapping. So a map the shell registers first cannot be silently overridden by a map a remote registers later.

    The design needs the three classes, one place that says which copy of a singleton wins, and a check; either sharing mechanism can provide them.

    The registration gate

    A warning in the console reaches nobody. The platform's alternative is to check when the manifest is built, so the user never meets the mismatch. The lab's checkVersion(host, build) is that check, in a few lines: accept a build when its contract number is one the shell supports and every singleton it requires is provided inside the range it states; allow a mismatch on a non-singleton package but list it as an "own copy".

    Expected output, captured from a real run (Node 26.13.1; section 1 of the demo):

    === 1. The registration gate: a version enters the manifest only if it fits the host
    orders@2.4.0   accepted  reuses design-system, react
    billing@1.9.0  accepted  reuses react; own copy of date-lib
    reports@0.8.0  refused   singleton react: needs ^19.0.0, host has 18.3.1
    reports@0.7.4  accepted  reuses react
    chat@1.0.0     refused   contract 3 is not supported (host supports 1, 2)

    This is the failure example caught early: the reports team's 0.8.0 needs a React major the host does not provide, so it never reaches the manifest, and the team is told in its pipeline, with the host's version in the message. The version numbers mean what the Semantic Versioning specification says: MAJOR for incompatible API changes, MINOR for backward-compatible functionality, PATCH for backward-compatible fixes; and a 0.y.z version is for initial development where anything may change at any time, which is why the lab's caret range below 1.0.0 is stricter than one above it.

    The contract between shell and remote

    The contract is a short document with a version number. It lists what the shell passes in (a mount node, the build version, a way to report errors and to read the session), what the remote must export (mount, update, unmount) and what it must not do (write outside its node, register global styles that match elements it does not own, throw during mount without a boundary around it).

    • The contract number is a MAJOR. The shell announces the numbers it can talk to (the lab's contracts: [1, 2]). A build written for a number the shell does not list is refused at the gate.
    • The shell supports two at a time. A new number is introduced while the previous one is still listed; dropping one is announced with a date.
    • Communication stays small. Fowler's article notes that custom events let micro-frontends communicate indirectly, which reduces coupling; single-spa names importing from another micro-frontend as its preferred way. Cross-App Communication compares them. Whatever is allowed, its message shapes are versioned with the contract.

    What a slot can be doing

    Figure 3. The life of one slot

    stateDiagram-v2 accTitle: Lifecycle of one slot in the shell accDescr: A slot starts idle, then loading. A successful load makes it ready. A failed load or a render error makes it failed, and a retry goes back to loading. After three failures a slot goes once to the previous known-good version and loads it. If that fails three times too, the slot is quarantined until a new release appears in the manifest or a person resets it. [*] --> Idle Idle --> Loading: load starts Loading --> Ready: load succeeds Loading --> Failed: load fails Ready --> Failed: render error Failed --> Loading: retry Failed --> Loading: third failure, go back to previous Failed --> Quarantined: third failure, nothing to go back to Quarantined --> Idle: new release or reset

    How to read this: the platform, not the team, owns this state. Only Ready shows the team's UI. Failed shows a message and a Retry button. Quarantined shows a message and no button, because asking again would repeat the same failure for every user who opens the page.

    The state is one pure function, step(state, event), which returns the next state and effects such as "load orders at 2.3.1" or "report this failure"; fetching and reporting are done by another layer. This is the shape of the chat core in the web chat case study, for the same reason: every ugly ordering of events becomes a unit test.

    Two rules in it deserve a sentence each.

    • Every result carries the version it was started for. A slow answer for a build the slot has already left is ignored. Without this, a late success of the bad build could replace the working previous build, and the user would see the failure come back.
    • Failures are counted per build, not per slot. The count resets when the slot moves to another version, so the previous build gets its own three tries.

    Failure isolation in layers

    A slot can fail in several places, and one mechanism does not cover them.

    Where it fails What catches it In the lab
    The files cannot be fetched (network, 404) A retry, a timeout, then the fallback load-fail
    The files load but initialisation throws The loader's error path load-fail
    The remote throws while rendering An error boundary around the slot render-error
    It fails later in a timer, a promise or an event handler A global error handler and reporting, not a boundary Not modelled
    It renders but breaks the layout or styles Style isolation; a visual check in CI Not modelled
    It is slow, not broken A time budget and a placeholder Not modelled

    React's documentation says a component with getDerivedStateFromError (and optionally componentDidCatch to report) is an error boundary, called when a child throws while rendering. Boundaries do not catch errors in event handlers, in server-side rendering, in the boundary itself, or in asynchronous code such as setTimeout callbacks, and there is currently no way to write one as a function component. Hence the second layer, global handlers (Error Boundaries and Global Error Handling), and the row for "later".

    Module Federation's error-handling article describes three layers that line up with the table: a retry plugin for the network, an errorLoadRemote hook for loading and fallback components, and a React error boundary as "the last line of defense". The platform adds what happens after all three have failed once, twice, three times.

    Startup is where isolation is easiest to lose

    Module Federation's shareStrategy option has two values. With version-first, the default, all remote entry files are loaded automatically during initialisation, so that the highest shared version can be chosen; the documentation says that if a remote is offline or unreachable this triggers the errorLoadRemote hook with the lifecycle beforeLoadShare, and that without a fallback initialisation may hang or fail. With loaded-first, remotes are loaded on demand, so an offline remote only causes a failure when its slot is used. The trade for a platform: version-first puts every remote on the critical path of startup, so it needs a fallback for every remote; loaded-first isolates startup.

    Quarantine is a client-side circuit breaker

    After three failures a slot stops asking. This is Resilient UI and Client Circuit Breakers applied to a slot. An unreachable remote is a problem for every user at once, and retries from every open tab can keep a recovering host down. The three-failure limit is the lab's assumption; a real platform tunes it and adds a delay between tries (Request Cancellation, Retries and Timeouts).

    Releasing and going back

    A release is a candidate build, a gate check and a manifest change. The manifest keeps, for each slot, the current and the previous build, where previous means the last build that was served successfully. The shell's rule is then mechanical:

    1. Try the current build; retry a failure up to the limit.
    2. Go to the previous build once, with a report that says so.
    3. If that fails too, quarantine and say so in the slot.

    Expected output, captured from a real run (Node 26.13.1; section 3 of the demo; the slot is orders):

    === 3. The same build keeps failing: after 3 failures the slot goes back to 2.3.1; if that fails too, it is quarantined
      load-fail orders 2.4.0 (2nd)  ->  applied
          effect: report orders@2.4.0: script timeout
      retry orders  ->  applied
          effect: load orders@2.4.0
      load-fail orders 2.4.0 (3rd)  ->  applied
          effect: report orders@2.4.0: script timeout; going back to 2.3.1
          effect: load orders@2.3.1
        orders   loading     2.3.1  failures 0  shows a skeleton
        billing  ready       1.9.0  failures 0  shows the remote 1.9.0
        reports  ready       0.7.4  failures 0  shows the remote 0.7.4
      load-ok orders 2.3.1  ->  applied
        orders   ready       2.3.1  failures 0  shows the remote 2.3.1
        billing  ready       1.9.0  failures 0  shows the remote 1.9.0
        reports  ready       0.7.4  failures 0  shows the remote 0.7.4

    The page went from a broken area to a working older area with no deploy and no human, and the billing and reports slots show the same state throughout; a lab test checks that their state objects are the very same objects.

    A few release rules follow from this.

    • Files are immutable; the manifest moves. New builds get new file names, as single-spa's guidance advises, so the previous build's files are still there when the shell goes back to them.
    • The manifest is small and cached briefly. A long cache delays every rollback by that long.
    • A kill switch is a manifest edit that removes or replaces the entry, through the same path as any release, only faster.
    • Staged exposure is a separate layer. The manifest answers "which build is current"; a rollout layer (Blue-Green, Canary and Rollbacks, Feature Flags and A/B Testing) answers "current for whom".

    Observability, accessibility and styles

    • Reports name a team. The report effect carries the slot, the remote name and the version; a real platform adds a trace identifier (Logging, Tracing and Correlation IDs, OpenTelemetry in the Browser). The shell's reporter rejects a report without a remote name and a version, because it cannot be routed.
    • One page, one accessibility tree. In the lab each slot is a labelled section, a fallback has an alert role so it is announced, and Retry is a button reachable by keyboard. An iframe slot needs a title, which MDN says lets assistive technology users tell what it contains (Accessibility Fundamentals).
    • Styles ignore team boundaries. Fowler's article shows styles leaking between micro-frontends and names BEM, CSS modules, CSS-in-JS and shadow DOM as ways to write them independently. The platform picks one rule and checks it (CSS Architecture and Scaling, Web Components and Shadow DOM).

    The data model

    The whole platform is two pieces of data and one function.

    Piece Fields Rule
    Host spec Contract numbers supported; shared packages with a version and a singleton flag Changed by the platform team, with notice
    Manifest entry Remote name, slot, critical flag, current build, optional previous build Changed only through the gate
    Build Version, contract number, required packages with ranges Immutable once published
    Slot state Remote, version, status, failure count, last error Owned by the shell; resets when the version changes

    A critical slot (orders, billing) shows a longer message when it fails; an optional one (reports) a short one. Neither takes the shell down. Criticality is a manifest field, so a team cannot decide for itself that it is critical.

    Build it: the platform core and a thin React shell

    Goal. Run the registration gate over five candidate builds, then drive the slot state through a render error, repeated load failures, a rollback and a quarantine, and see that sibling slots never change.

    Setup. The lab micro-frontend-platform is in the course's example workspace (Node 26, React 19, Vitest 5, jsdom). It does not repeat cross-app-communication (messages between apps) or plugin-host-model (extension points): its subject is the shell's rules about versions and failure. The logic is step(state, event) plus checkVersion; Shell is a thin React layer where each slot reads only its own state with useSyncExternalStore and sits inside its own error boundary. A remote is a component returned by a function the test supplies.

    cd examples/frontend
    pnpm install
    cd labs/micro-frontend-platform
    pnpm test           # 27 tests: 22 for the core, 5 React (jsdom)
    node src/demo.ts

    Steps.

    1. Run the tests, then the demo, and compare section 1 with the output above: reports@0.8.0 is refused for its React range, chat@1.0.0 for its contract number, and billing@1.9.0 is accepted with its own copy of a non-singleton package.
    2. In section 2, orders throws while rendering and its slot shows a fallback with Retry; billing and reports stay ready, and the last line prints true when the billing state is the same object as before.
    3. Compare section 3 with the output above: the third failure sends the slot to its previous version.
    4. In section 4, a late load-ok for the abandoned version is answered with ignored-stale-version.
    5. In section 5, the previous version fails three times too and the slot is quarantined. A retry is refused, a manifest refresh with the same releases changes nothing, and a new release puts the slot back to idle.

    Expected output, captured from a real run (Node 26.13.1; the end of section 5):

      load-fail orders 2.3.1 (3)  ->  applied
          effect: report orders@2.3.1: network error; quarantined
      retry orders  ->  ignored-quarantined
        orders   quarantined 2.3.1  failures 3  shows: orders is unavailable. Please contact support if you need it.
      manifest-update (a refresh, same release)  ->  applied
        orders   quarantined 2.3.1  failures 3  shows: orders is unavailable. Please contact support if you need it.
      manifest-update (orders 2.4.1)  ->  applied
        orders   idle        2.4.1  failures 0  shows a skeleton

    What the lab does not show. No real bundler, no Module Federation runtime, no import map, no script loading, no timeouts or time (the caller feeds events by hand), no real browser (the React tests run in jsdom, which does not lay out or paint), no styles, no authentication and no routing. The manifest fields, the contract number and the three-failure limit are this lab's own design, and the semantic-version subset is a small one written for the lab and not checked against the npm implementation.

    Break it. In src/manifest.ts, in checkVersion, change } else if (provided.singleton) { to } else if (false) {. A singleton mismatch is then treated as "bring your own copy" and accepted; the test "refuses a singleton mismatch" fails. Restore the line and run the tests again.

    Trade-offs

    Decision Option A Option B Reference choice
    Composition One mechanism for all slots A mechanism per slot, from a short list Per slot; run-time modules by default
    Singleton packages Warn on mismatch Refuse at the gate Refuse at the gate; users never see it
    Other shared packages Share everything Share only large ones Share large ones; duplicates are counted
    Startup Load every remote first Load a remote when its slot is drawn Load on demand; the host stays up when a remote is down
    Failure Show an error page Show a fallback in the slot A fallback in the slot, then the previous build
    Retries Retry forever Count, go back once, quarantine Count and quarantine

    In practice: a nine-team operations portal

    NOTE

    This is a realistic scenario, not a case history. It is a composite built from common production patterns. It describes no specific company or product, and every number in it is an illustrative assumption.

    The situation

    An internal operations portal grew from one application to nine teams' areas. Releases are a monthly train with a freeze week, and two incidents in a quarter came from one team's change breaking another team's page. Each team should release on its own, without losing the guarantee that one area does not break the others.

    Starting architecture

    Figure 4. Starting point: one bundle, one release, one failure domain

    Starting architecture: nine teams commit to one bundle that ships once a monthNine teams to One bundle (merge, freeze); One bundle to The portal (one failure domain)Nine teams: one repositoryNine teamsone repositoryOne bundle: monthly releaseOne bundlemonthly releaseThe portal: all areas togetherThe portalall areastogethermerge, freezeone failure domain

    How to read this: any team's mistake reaches the whole page, and any team's urgent fix waits for the train.

    Options considered

    Option What it fixes What it costs Risk
    Keep one bundle, add module boundaries and tests Accidental coupling Cheap The release train and the single failure domain remain
    Per-area iframes Isolation and independent release Navigation, sizing and messaging work in every area A slow, awkward user experience
    Run-time modules through a manifest, with a gate and per-slot fallbacks Independent release and isolation A gate, a manifest, version rules and a platform team The platform becomes a product that needs an owner

    The decision

    Field Decision record
    Context Nine teams, a monthly train, cross-team breakage.
    Decision Run-time modules through a manifest with current and previous builds per slot; React as a singleton; a registration gate in each team's pipeline; a boundary, a retry limit, a rollback and a quarantine per slot; a report with remote name and version on every failure.
    Consequences, good Independent releases; a bad build is replaced by the previous one without a deploy; failures name a team.
    Consequences, bad A platform team to run the gate and the manifest; a contract to version; more moving parts than one bundle.
    Revisit when A slot needs hard isolation (an iframe), a slot needs first-response HTML (server composition), or fewer than three teams remain.

    Rollout and verification

    1. Start with one area. Move the least critical area behind a slot with the gate in its pipeline, and leave the rest in the main bundle (the migration lesson describes the strangler approach).
    2. Drive the slot state with recorded event sequences, including a late answer for an old version.
    3. Watch three counters: reports per remote and version, slots going back to a previous build, and quarantines. A quarantine pages the owning team.
    4. Rehearse the rollback. A rollback nobody has performed is a hope.

    The 2 a.m. failure

    A team publishes a new build by overwriting the files of its current build in place. A long-lived cached copy of the manifest still points at the old file names for some users, while the host serves the new files under them. The chunks no longer match the entry. Load failures climb for that slot only. The shell retries three times and goes to the previous build, whose files were not overwritten, and the slot works again (illustrative). The reports name the remote and the version, so the team is paged and not the platform team.

    First three checks: (1) do the reports share one remote and version; (2) was the file name reused by the last release; (3) how old is the manifest the failing browsers hold. Mitigation: point the manifest at the previous build for everyone and shorten its cache. Follow-up: make the gate reject a candidate whose file names already exist, because immutable files are what make a rollback possible.

    The other side of this topic

    On the back end the same problem is service ownership and independent deployment of the APIs the slots call: see Microservices Decomposition and Data Ownership. A slot that needs six services to draw one table has a boundary in the wrong place.

    Architect's notes

    • Write the contract before the platform. Mount, update, unmount, the error channel and a version number are the whole API; add to it slowly.
    • Make the gate a pipeline step.
    • Keep the list of singletons very short. Each one ties every team to one upgrade schedule.
    • Give every slot a fallback before giving it a feature.
    • Own the platform like a product.

    Common mistakes

    • Sharing everything, or sharing nothing.
    • Treating a console warning as a control. Refuse a bad build before release.
    • Overwriting files in place, which removes the build you want to go back to.
    • Counting failures per slot instead of per build.
    • Letting a remote decide whether it is critical.
    • Retrying forever.
    • Reporting without a remote name and version.

    Key takeaways

    • A platform is a contract: mount, update and unmount, plus a version number, shared packages and an error channel.
    • Choose composition per slot; most slots of an enterprise portal use run-time loading, and the exceptions need their own mechanism.
    • Sort packages into singleton, shared and private; refuse a build that cannot use a singleton before it is released.
    • Keep a current and a previous build per slot; files are immutable and the manifest moves.
    • Isolate failure in layers, count failures per build, go back once, then quarantine.
    • Make the state of a slot a pure function with effects, so the hard orderings are unit tests.

    Practice exercises

    1. Two packages that move together. Make the gate refuse a build whose requirements for react and react-dom are different majors. Write the test first.
    2. Kill switch. Add a kill event that quarantines a version for everyone without a new manifest. What does a user see, and who is told?
    3. Time budget. Emit a load-fail with a timeout reason from a virtual clock; how long should a critical slot wait compared with an optional one?
    4. Break the rule. Delete the version check in load-ok and write the test that shows a bad build replacing the working previous one.
    5. Pick the slot. For a slot that must be in the first HTML, one that embeds a less trusted partner's widget, and one that three teams release daily, name a mechanism from Figure 2 and what you give up.

    Official documentation

    Ask about this article

    Get answers grounded in this post. AI-generated — based on this article, and may be imperfect.

    Scaled AI Weekly

    Enjoyed this? Get more like it every Monday.

    Real architecture decisions, LLMOps patterns that survive production, and engineering leadership advice — from 12+ years of building at enterprise scale. Free. No spam. Unsubscribe anytime.

    Get new articles by email

    Free. We email a confirmation link first, and you can unsubscribe from any email.

    Join engineers building production AI systems

    Comments