Global multi-region platform: learn and design
- Source
- From the Staff AI System Design course
- By
- Sourav Banerjee
- Last updated
- 8 Nov 2026
Compare Placement and Recovery Options
| Option | Benefit | Cost or failure | Fit for this requirement |
|---|---|---|---|
| One region plus backups | Lowest live duplication | Restore and capacity acquisition may miss recovery target | Baseline if customers accept longer outage |
| Tenant home region with same-geography warm secondary | Local writes and policy boundary; recovery capacity partly running | Replication lag, reserved capacity and promotion runbook | Choose for EU A/B |
| Every region writes every tenant | Local writes in more locations | Conflict resolution, global identity/budgets, residency and split-writer risk | Reject without a demonstrated requirement |
| Synchronous cross-region replication of tenant data | Less acknowledged-state loss when a quorum survives | Write latency on every request, partition availability and permitted-region constraints | Reject for bulk data; apply only to the small authority class below |
A cell is a regional failure boundary containing enough application and data services to serve its assigned tenants. Tenant home placement chooses one writer region for that tenant. Different tenants can be active in different cells; that is not concurrent global writing of Alice's operation. Add EU-secondary as a warm recovery target with verified artefact and quota reservations. Tenant C continues in US-home. There is no permitted US failover for A/B under this scenario.
Specify the Network and Control Boundaries
Alice's request crosses several network edges before a model sees it. Each edge can leak content or deliver it to the wrong region. Five terms name those edges; TLS and mutual TLS return from T18.2 and T18.7:
- Ingress is the regional entry point that accepts client traffic. Egress is any outbound path, such as a call to a model provider.
- Transport Layer Security (TLS) encrypts a connection and proves the server's identity with a certificate. Mutual TLS also proves the client's identity.
- A private endpoint exposes a service only on the cloud provider's internal network, with no public address.
Follow the request in order:
- After sign-in, the trusted placement directory binds Tenant A to the EU hostname. That host resolves only to EU ingress, and its TLS key exists only there, so Alice reaches the EU wherever she is. The Domain Name System (DNS) then chooses only between EU-primary and EU-secondary ingress. Resolvers cache that answer for its time to live (TTL), so a switch reaches some clients late.
- EU ingress terminates TLS and strips caller-supplied identity headers.
- Ingress authenticates from the headers and resolves trusted placement before reading the body. A tenant not placed at this ingress is rejected. No body goes into redirects, URLs or edge logs.
- Inside the cell, services call each other over authenticated paths with scoped credentials. Private endpoints, firewall rules, private DNS, routes and controlled egress must agree. Private connectivity reduces exposure; it does not authorise a resource.
- Before dispatch, the Model Gateway checks the provider profile's processing and storage geography and the model's approval.
Deployment pins image and model digests, then tests readiness, connections, secrets and drain (stopping new work to an instance while its in-flight work finishes) in each cell. A machine accepting TCP connections is not evidence that an adapter is loaded.
The global control plane publishes placement and approved templates. It stays off each prompt's critical path and never holds authority. A signed, bounded-age regional snapshot can serve placement discovery but grants no document access. On control-plane loss, freeze placement changes. Existing authorised work continues only while the regional authority quorum, audit and budgets are available.
Choose Regional Entry and Deployment
| Decision | Option | When it wins | Cost or failure |
|---|---|---|---|
| Regional entry | Residency hostnames: the EU host resolves only to EU ingress; DNS chooses within the EU | The endpoint enforces residency: the EU key exists only in EU ingress, wherever the user is | Clients must use their host; cached answers delay an EU-primary to EU-secondary switch by up to the TTL |
| Regional entry | DNS geo-routing on one shared hostname | Lowest latency for users near their home region | Picks by the resolver's location, not the tenant: an A/B user resolving from the US reaches US ingress, where TLS ends. Nothing at entry enforces residency |
| Regional entry | Anycast load balancer (one address announced from many edges; the network picks a nearby one) with EU-only edges for the EU host | One fixed address per residency and a switch without DNS caching | The provider's edge set and key placement enforce residency, so both need continuous audit; global configuration is a shared failure point |
| Service exposure | Private endpoints for the Model Gateway, stores and provider | Default for cell-internal and provider paths | Private DNS and routes in every cell; harder to debug |
| Service exposure | Public endpoint with mutual TLS | A partner that cannot join the private network | Internet-reachable; certificate rotation and allow-lists become the boundary |
| Regional deployment | Rolling update within a cell | Small, backward-compatible changes | Old and new versions serve together; rollback is gradual |
| Regional deployment | Blue/green within a cell | Model Gateway or adapter changes that need a clean cut-over | Double capacity during the switch; the recovery reserve must cover both |
Choose residency hostnames, private endpoints, and blue/green for Model Gateway changes, one cell at a time. Anycast with EU-only edges also enforces residency and wins when a customer needs one fixed address; it loses here because residency would rest on a provider's edge configuration. Geo-routing on a shared hostname is rejected, because user location would decide where A/B content is decrypted.
Design task. Trace Alice's request from the EU hostname to the EU-secondary Model Gateway after failover. Mark where content may be logged and where a request at the wrong ingress is rejected. Choose a DNS TTL against the 30-second route-convergence budget, assuming the record update itself takes 5 seconds. Then choose how to ship a Model Gateway image change to EU-secondary.
Reveal after answering
The EU hostname now resolves to EU-secondary ingress; it never resolves outside the EU. TLS ends there, and edge logs hold metadata only. Authentication and placement run on the headers. A Tenant C user at this ingress, or an A/B client misconfigured to call the US host, is rejected at that ingress before the body is read. The app service calls the Model Gateway over a private endpoint, which dispatches to an EU provider profile. Content is written only to the protected EU operation and audit stores.
For the TTL, 5 seconds of update plus a 20-second TTL leaves 5 seconds of margin inside 30 seconds; a 60-second TTL misses the budget. A 20-second TTL triples DNS lookups compared with 60, and some resolvers ignore it, so measure convergence from client success. Ship the image blue/green inside EU-secondary, keeping the old version until readiness and approval checks pass.
Assign Consistency by Data Class
| Data class | Replication and recovery choice | Unsafe shortcut |
|---|---|---|
| Policy, membership, writer lease and epoch, budget grants, model approval/withdrawal, release-bundle generation, alias-to-digest bindings, deletion tombstones and current source versions | EU authority store on the 2-of-3 EU quorum; promotion needs a new lease and a refused old epoch | Trusting a lagging copy for revocation, deletion, quota or a withdrawn adapter |
| Committed result/history and operation keys | Async ordered log; loss bounded at isolation by last renewal + lease − watermark; inspect ambiguous operations | Treating missing post-failover row as proof no remote work happened |
| Immutable source bodies, datasets, adapters and checkpoints | Copy by digest within geography; verify complete manifest before readiness | Loading a registry alias whose artefact is absent |
| Index and immutable caches | Rebuild from source copies checked against the quorum's current versions and tombstones; keep live gates | Serving old search hits to bypass unavailable authority |
| Usage and audit | Protected regional evidence keyed by tenant, operation and attempt; classification-aware aggregates | Counting a redelivered attempt twice or dropping failed-attempt spend |
T18.11's approval and alias records are mutable trusted state, so they sit in the authority row. An adapter copied by digest may have been withdrawn after the copy. Restore therefore verifies the current approved generation from the authority store, not only the artefact digest. Tombstones and current versions sit there too, as T18.8 required, so a deletion acknowledged inside the lag window survives promotion. Every delete pays quorum latency.
Because async replication can lose acknowledged operation records within RPO, automatic redispatch after failover is unsafe for the uncertain interval. Keep a recovery hold on affected operations and reconcile provider/external status using original identities. A stronger zero-loss operation journal would need its own synchronous durability design and latency cost. This stage does not claim to implement that journal or the consensus protocol behind the authority store.
Key Takeaways
- Each tenant has one home writer cell with a warm same-geography secondary. Every-region writes and synchronous replication of bulk tenant data are rejected, and Tenants A and B have no permitted US failover.
- Writer authority, policy, approvals and deletion tombstones sit in an EU-only authority store on a 2-of-3 quorum. A lease lapses 20 seconds after its last renewal, and each new lease raises the epoch, the fencing token stores use to reject older writes.
- Promotion waits out epoch 7's lease plus a drift margin, takes epoch 8, installs it in every store and confirms each refuses an epoch 7 probe. An unreachable writer is not a fenced writer, and a lost quorum fails closed even past the RTO.
- The EU residency hostname resolves only to EU ingress, where its TLS key lives. Geo-routing on a shared hostname is rejected because user location would decide where A/B content is decrypted, and a 20-second TTL plus a 5-second update fits the 30-second convergence budget.