Multi-Region and Geo-Distributed Systems Questions
Running a system across regions and continents: multi-region replication, data residency and sovereignty, geo-routing and CDN edge distribution, cross-region consistency and quorum placement, and conflict resolution when two regions accept writes. Covers regional failover and split-brain prevention, recovery objectives (RTO/RPO), region-by-region rollout and blast-radius containment, and the latency, cost, and consistency tradeoffs of going global. Global distribution strategy across the service and data tiers.
You must architect a simple global web application serving static assets and dynamic APIs with 99.95% availability and median frontend latency <100ms for users worldwide. Sketch a high-level multi-region architecture using CDN, regionally deployed app servers, databases, and failover. Explain key design choices and trade-offs.
Sample Answer
For a simpler target (99.95 percent availability, sub-100ms median latency, static assets plus dynamic APIs, no exotic scale numbers given), the design is the same shape as a large-scale one but with fewer moving parts: a CDN (content delivery network: a globally distributed edge network that serves cached content from close to the user) for static content, three regionally deployed, active stateless app-server clusters behind global, health-checked load balancing, and one database with a primary and cross-region read replicas. At this scale a fully multi-master database is more operational complexity than the requirements justify.
Architecture
Users hit the CDN for static assets, which handles most of the latency-sensitive traffic without ever touching a regional server. Dynamic API requests go through a global, latency-based, health-checked load balancer to the nearest of three regional clusters (North America, Europe, Asia-Pacific), each running identical, stateless application servers. The database has one write primary in a chosen region with asynchronous read replicas in the other two, so reads are fast everywhere and writes go to the primary, accepting a modest cross-region latency penalty on writes in exchange for a much simpler consistency story than a multi-master setup.
Worked example
Work the latency budget from the geography, because light in fibre travels at roughly 200,000 km/s (about two thirds of c) and a real route is typically 1.3 to 1.5 times the great-circle distance. That gives a hard floor nothing in the stack can beat.
A cached static asset served from a nearby CDN edge typically returns in single-digit milliseconds, and the CDN is what carries most users. A dynamic API call to the nearest regional cluster, doing local computation and reading from a local replica, takes 20 to 40 milliseconds of round trip plus processing for a user who is IN or NEAR one of the three regions, which is comfortably inside a 100ms median.
The phrase "for users worldwide" is where three regions stop being enough, and the arithmetic should be stated rather than assumed. Taking clusters in Northern Virginia, Frankfurt and Singapore, and measuring each user to their nearest one: Sao Paulo to Northern Virginia is 7,654 km great circle, which is a 77ms round trip on a physically impossible dead-straight path and about 107ms on a realistic route. Johannesburg to Singapore is 8,659 km, 87ms straight-line and about 121ms realistic. Santiago to Northern Virginia is 8,081 km, 81ms and about 113ms. Sydney to Singapore is 6,306 km, 63ms and about 88ms. For South American and African users the network alone consumes the whole budget before a single line of application code runs, so the honest statement is that three regions meet the target for North America, Europe, and most of Asia-Pacific, and miss it for South America and Africa. If the sub-100ms median genuinely has to hold for those users too, the options are a fourth and fifth cluster (Sao Paulo and Cape Town or Johannesburg) or moving enough of the dynamic path to the edge that those users are served by the CDN tier rather than a regional cluster. Naming the gap is the answer; quietly averaging it away is not.
The same floor governs writes, and it is worse than people expect. Northern Virginia to Frankfurt is 6,553 km, so about 66ms at the straight-line limit and roughly 92ms realistically; Northern Virginia to Singapore is 15,532 km, which is 155ms round trip even straight-line and about 217ms on a real path. A write that has to reach a primary on the far side of the Pacific therefore blows the 100ms budget outright, not merely threatens it, which is exactly why writes stay on a deliberately narrower, primary-only path while reads are served locally.
One more thing makes that trade legitimate, and it is worth saying explicitly because it is the actual reason: the requirement is a MEDIAN, not a p95 or a mean. If writes are a minority of requests, say 10 to 20 percent, then even a 217ms write path leaves the median sitting squarely on the fast local read path. The single-primary design is acceptable because of the shape of the statistic in the requirement, not because the requirement is silent about writes.
Trade-offs
A single-primary database is simpler to reason about and operate than a multi-master setup, at the cost of every write from a distant region paying a full wide-area round trip; that trade is acceptable here because nothing in the stated requirements demands low-latency writes from every region, only low-latency reads and high availability, which read replicas and a CDN already provide.
Pitfalls
Relying on DNS alone for failover is slow, because clients and resolvers cache DNS answers past the stated TTL in practice; pairing DNS-based routing with a global load balancer that performs its own health checks gives a faster, more reliable failover path than TTL expiry by itself. The other common gap is forgetting that a promoted read replica needs its own failover automation, not just an assumption that the database is technically still up somewhere.
Design identity federation and authorization for a multi-tenant SaaS spanning regions with local regulatory constraints. Include token issuance models, central vs regional identity providers, cross-region token validation, key rotation, privacy considerations, and approaches to minimize authentication latency.
Sample Answer
Direct answer
Split identity into two planes. A small, globally-replicated control plane holds
tenant metadata (which region owns each tenant's user data, which identity provider (IdP)
config to use) and public signing keys. Each region runs its own data plane: the actual
user records, credentials, and multi-factor state, kept local to the region that satisfies
that tenant's regulatory residency requirement (an EU tenant's users live and authenticate
in an EU region, a healthcare tenant's users might need to stay in a specific country).
Tokens are short-lived, self-contained, and signed locally, so any region can verify them
without a network call back to the issuing region. That combination is what keeps both
compliance and latency intact at the same time.
How the pieces fit together
Central vs. regional identity provider (IdP). Don't run one global IdP that stores
every tenant's credentials in one place: that creates a single point of both latency and
regulatory failure (a login from Frankfurt round-tripping to us-east-1, or EU personal data
sitting on US soil). Instead, run a regional IdP per data-residency zone, using a standard identity protocol such as OpenID
Connect (OIDC) or SAML (Security Assertion Markup Language, an older but still common protocol that does
the same job), and a thin central directory that maps tenant_id
to "which region's IdP owns this identity." That directory is the one thing worth
replicating globally, because it is small (millions of rows of tenant_id -> region, not
user PII) and read-heavy: a global key-value store with fast eventually-consistent reads
(a global secondary index, or a CDN-fronted lookup service) is enough.
Keep that directory tenant-scoped, and resist the obvious extension of putting user_id in
it, because a user_id -> region table is a different object legally, not just a bigger one.
A user identifier the operator can re-attach to a person through its own regional identity
store is pseudonymised data, and pseudonymised data is still personal data under EU rules
rather than anonymous. Replicating that table everywhere therefore puts a copy of EU personal
data in every region you operate in, which is precisely the outcome the regional data plane
exists to prevent, and it would be the first thing an auditor pulled on. If a login flow
genuinely needs user-level routing, because the same email address can exist under two
tenants, get it without a global user index: carry a tenant hint in the login URL or
subdomain, or let the nearest regional IdP answer "not mine" and hand the flow off. Either
costs one extra hop on a rare login. A global user index costs a permanent, replicated copy
of who your users are. When a login request
lands at any edge, the gateway does one cheap lookup, then redirects the login flow to the
correct regional IdP.
Token issuance. The regional IdP that owns the user issues a signed token (an OAuth2
access token or OIDC ID token, typically a JWT: a compact, digitally signed JSON payload)
after authentication. The token carries claims (user id, tenant id, roles, expiry) but
deliberately minimal PII, since the token itself will travel to whichever region actually
serves the request, which may not be the user's home region.
Cross-region token validation. Because the token is self-contained and signed, a
service in any region can verify it locally: fetch the issuing region's public key from a
JWKS endpoint (JSON Web Key Set, a small published document of public verification keys),
cache it, and check the signature and expiry. No call back to the issuing region is needed
per request, which is what keeps steady-state latency regional. Only the public keys cross
regions, never the private signing key or the underlying credential store.
Key rotation. Each region owns and rotates its own signing key pair independently.
Publish the new public key to the shared JWKS well before the old key is retired (an
overlap window, commonly 24 to 72 hours), so tokens signed just before rotation still
validate everywhere. Retire the old key only after that window passes and after the
longest-lived token issued under it has expired. Never let one region's key compromise
force a rotation of every other region's keys: keys are per-region, isolated blast radius.
Privacy. Two separate residency concerns exist: where the user record lives (must
stay in-region, enforced by the data-plane split above) and what the token carries as it
crosses regions (must be minimal: an identifier and role claims, not name, email, or other
attributes a downstream region has no legal basis to hold). Treat token content
minimization as its own privacy control, separate from where the account record sits.
Minimizing authentication latency. Login (issuance) is rare and can tolerate one
cross-region hop to the home IdP. Token validation (checked on every API call) is the hot
path, and it is local: signature check against a cached public key, no network round trip.
Design so the expensive part happens once per session, not once per request. Be careful about
what that actually removes, though: it takes authentication out of the per-request cross-region
budget, it does not take data access out of it. Where the tenant's records live is a separate
placement decision, and for a residency-pinned tenant it is a decision you are not free to
make.
Worked example
A tenant based in Germany has users authenticating against the eu-west IdP. A user opens
the SaaS from a hotel in Singapore; the request lands at the nearest edge (ap-southeast).
The gateway looks up tenant_id -> eu-west in the global directory (a few milliseconds),
redirects the login to the eu-west IdP, and the user authenticates there. The eu-west
IdP issues a JWT signed with its current key. Every subsequent API call from that session is
authenticated wherever it lands: ap-southeast services fetch (and cache) eu-west's public key
from the shared JWKS once, then verify the token locally on every call, with no callback to
eu-west to authenticate anything. State the win precisely, because it is easy to overclaim. The
authentication hop is gone from the request path. The request is not therefore local: this tenant's
records are pinned to eu-west by the same residency rule that put its IdP there, so any call that
actually reads or writes German tenant data still crosses to eu-west and pays that round trip.
What ap-southeast can genuinely serve on its own is the work that touches no residency-bound data,
static assets, decisions derivable from the token's own claims, region-agnostic reference data,
anything already cached at the edge. The user's PII record never leaves eu-west; the token in
transit carries only user_id, tenant_id, and role claims.
Trade-offs and pitfalls
- The tenant-to-region directory becomes a hard dependency. If it is unavailable, no
region knows where to route a fresh login. Make it read-cacheable at the edge with a
generous time-to-live (TTL), since tenant-to-region mapping almost never changes. - Token replay across regions is a real risk once tokens are globally valid. Keep
expiry short (minutes, with refresh tokens handled by the home region only) and consider
binding tokens to a specific audience or region claim if a tenant's compliance posture
requires that a token issued for one jurisdiction cannot be replayed to serve data in
another. - When you present this design to executives or legal stakeholders, frame it as a
risk-reduction trade, not a pure engineering choice: "the regional data plane is what
lets us tell a regulator that EU user data never leaves the EU; the central directory is
a small, non-sensitive index that makes that possible without adding a network hop to
every request." That framing is usually what actually gets the design approved, because
it answers "what does this cost us in risk" before "how does it work." - Don't over-centralize "just for convenience": a single global IdP is simpler to operate
on day one, but it forecloses the regional data-residency story you will need the moment
a large regulated customer asks where their users' credentials are stored.
Design a data ownership and governance model for a federated global platform: each region runs independent microservices but central data governance is required for security, schema evolution, and access control. Describe metadata catalogs, API contracts, versioning policies, and how to enforce global policies while preserving regional autonomy.
Sample Answer
Direct answer
Separate what must be centrally enforced, a deliberately short list like security policy, schema and API compatibility rules, and access control, from what regions own, their own deployment cadence, storage choices, and scaling decisions. Enforce the central list through shared infrastructure regions can't opt out of, not through a policy document they're expected to remember.
Framework
- Metadata catalog: a central, searchable registry of what data each region's services own, its schema, its sensitivity classification, and who's accountable for it, so a compliance review can answer "who has data like this" without emailing every region's team.
- API contracts and schema evolution: every service other regions depend on publishes a versioned contract and is required to make only backward-compatible changes without a coordinated migration. A compatibility check runs automatically at build or deploy time and blocks a breaking change from shipping, rather than relying on a team remembering the rule.
- Access control: enforce the global policy, for example no service may read another region's raw personal data without an explicit, logged grant, at a shared gateway or service-mesh layer every region's traffic passes through, so a regional team physically cannot bypass it even if they wanted to.
- Versioning policy: track schema and API versions in the catalog with deprecation timelines, so a region can evolve its own service on its own schedule as long as it honors the compatibility window it advertised to consumers.
- Preserving regional autonomy: regions choose their own storage engine, scaling strategy, and release cadence for anything not on the centrally-enforced list. The central platform team's job is maintaining the shared enforcement infrastructure, the catalog, the compatibility checker, the policy gateway, not reviewing every regional decision.
Worked example
One region's order service wants to add a new required field to its event schema. The registry
check is a pure schema-versus-schema comparison against the previously registered version, judged
under the compatibility mode configured for that stream, and under the common backward-compatible
setting a field added with no default fails outright: a consumer running the new schema could not
read the events already written under the old one. The registry has no idea who the consumers are,
and that is the point, the gate is mechanical and there is nobody to argue with. The team adds the
field as optional with a default instead, which passes, and only then uses the catalog to find
which regions actually consume that stream and to track them onto the new version before tightening
the field in a later release. Note the division of labor: the automated check blocks the unsafe
change with no central review, while the catalog turns the follow-up coordination into a short list
of named owners rather than a broadcast email to every region.
Trade-offs and pitfalls
Making the centrally-enforced list too large turns the platform team into a bottleneck for every regional decision, defeating the autonomy goal. Making it too small, or enforcing it by policy document instead of infrastructure, is how compliance and compatibility violations quietly accumulate region by region until an audit finds them.
Explain quorum selection in geo-distributed replication. Define N (replica count), R (read quorum), and W (write quorum), state the rule for strong consistency (R + W > N), and provide a numeric example (N=5) showing read and write behavior when nodes are down. Discuss how quorum sizes affect latency and availability.
Sample Answer
Direct answer
Quorum consistency guarantees a read always overlaps with the most recent write by requiring the read set and write set to intersect on at least one replica. With N replicas total, a read quorum of R and a write quorum of W, that overlap is guaranteed exactly when:
R+W>NIf that inequality holds, every read touches at least one replica that has the latest write, so the client is guaranteed to see it (assuming no further concurrent writes).
Numeric example, N = 5
Take R = 3 and W = 3. Check the rule: 3 + 3 = 6 > 5, so this configuration gives strong consistency.
- All 5 nodes up: a write needs acks from any 3 of 5; a read needs responses from any 3 of 5. Because
3 + 3 = 6 > 5, any 3-node write set and any 3-node read set must share at least one node, so the read always sees the write. - 2 nodes down (3 up): a write can still succeed, it needs exactly the 3 nodes that remain up. A read also still succeeds, needing exactly those same 3 nodes. The system is fully available but with zero slack, one more failure blocks everything.
- 3 nodes down (2 up): a write needs 3 acks but only 2 nodes are reachable, so writes fail. Reads also fail (need 3, only 2 available). The system is unavailable rather than inconsistent, which is the point of a hard quorum threshold: it refuses rather than returns a stale or conflicting answer.
Now compare a read-optimized configuration: R = 2, W = 4 (2 + 4 = 6 > 5, still strong). Reads tolerate up to 3 node failures (only need 2 of 5), but writes tolerate only 1 failure (need 4 of 5). This is the shape you'd pick for a read-heavy workload that can afford slower, less available writes.
How quorum size affects latency and availability
A write (or read) only completes once the slowest of the required acknowledgments arrives, so raising W (or R) raises tail latency and lowers availability, because more nodes must be simultaneously reachable and healthy. Lowering either improves latency and availability but shrinks the overlap the consistency guarantee rests on, down to a single shared replica as soon as R + W = N + 1 exactly, as in the R=3,W=3 case above. Keep the two margins separate when reasoning about this, because they move in opposite directions: the overlap margin is R + W - N (one replica here, the smallest value that still forces every read set to touch a replica holding the latest write), while the failure margin is N - W for writes and N - R for reads (two apiece here, which is exactly why the R=3, W=3 configuration still survives losing two nodes). Lowering W raises the write failure margin and lowers the overlap margin at the same time; it is only the second of those that the R + W > N rule is protecting.
Global deployment with uneven latency
When quorum members are spread across regions with very different round trips, the slowest required member sets the whole operation's latency, not the average. If N = 5 has three members in nearby regions (a few milliseconds apart) and two members on a distant continent (100ms+ round trip), a naive W = 3 quorum can accidentally require waiting on a distant member depending on which three happen to be healthy and reachable. The practical fix is to bias placement so the required quorum size can usually be satisfied entirely from the nearby cluster (for example N=5 with 3 nearby and 2 far, W=3 met by the 3 nearby members in the common case), keeping the far members as durability insurance rather than a latency cost paid on every write, while still counting them toward R + W > N so a full regional loss doesn't strand the system.
Trade-offs and pitfalls
Quorum math guarantees overlap, not recency in wall-clock terms; if writes aren't also versioned (a timestamp or sequence number) a quorum read can't tell which of several returned values is newest. And a quorum system trades availability for consistency at the edges: as the earlier example showed, losing exactly N - W + 1 nodes doesn't degrade gracefully, it stops writes outright.
You experienced a 3-hour partial outage in the European region that increased latency and generated client errors. As the SRE lead, outline the post-incident review you would run: what data to collect, how to reconstruct the timeline, approaches to root cause analysis, remediation tasks, stakeholder communication, and preventative measures to add to the runbook.
Sample Answer
Direct answer
A post-incident review after a regional partial outage should reconstruct exactly what happened before assigning blame, quantify the real impact, find the root cause and its contributing factors, and turn findings into tracked remediation with named owners and dates.
Framework
- Data to collect: the timeline of events (deploys, config changes, alerts fired, on-call actions), metrics for the outage window versus a normal baseline (error rate, p50/p95/p99 latency, meaning the response time at the median and the slower 95th and 99th percentiles, resource saturation, meaning how close a resource like CPU is running to its limit, regional traffic split), sampled logs and distributed traces from affected requests, support ticket volume, and the cloud provider's own status page history if a dependency was involved.
- Reconstructing the timeline: normalize every timestamp to UTC first. Different teams logging in local time is a common source of a timeline that contradicts itself. Merge events from monitoring, deploy tooling, and the incident chat into one ordered log, and anchor it against trace IDs so you can see exactly which requests were touched by which change.
- Root cause approaches: stay blameless. Use "5 whys" for a single linear cause chain, or a fishbone (Ishikawa) diagram (a branching diagram that groups candidate causes into categories, like people, process, and systems, feeding into a single spine that points at the effect) when several contributing factors combined, for example a config push plus an already-saturated connection pool (the fixed set of reusable database connections a service shares across requests) plus a slow health check. Separate the triggering event from the underlying weaknesses that let it cascade into a 3-hour outage instead of a 10-minute blip.
- Remediation tasks: rank by likelihood of recurrence times blast radius (how much of the system or how many users a failure could affect) times effort, not by who argues loudest in the review. Give each item an owner and a due date, and mark a small subset as blocking before the incident can be closed.
- Stakeholder communication: engineering gets the full technical timeline; leadership gets impact numbers (duration, users affected, any SLA exposure, SLA meaning the contractual reliability commitment made to customers) plus the top fixes; customers get a short, plain-language summary of what they experienced, with no internal jargon and no premature root-cause claims.
- Runbook additions: turn each remediation into either an automated guardrail (a canary check, a tighter alert threshold) or an explicit manual step with a decision tree, so the next responder doesn't have to re-derive today's judgment calls under pressure.
Worked example
During the reconstructed timeline, the region's connection pool was sized for 500 concurrent connections. A downstream DNS change broke connection reuse, exhausting the pool in roughly 4 minutes and pushing p95 latency from 180ms to 3.2 seconds before an alert fired at the 6-minute mark. Detection, though, is the first 6 minutes of a 180-minute outage. A review that stops there has explained about 3 percent of the incident and left the other 97 percent unaccounted for, which is the single most common way a post-incident review produces cheap action items and no durable improvement. Slice the remaining time the same way you sliced the timeline and attach an item to each slice:
- Minutes 6 to 35, triage. The responder saw elevated latency and started on the application tier, because nothing in the alerting pointed at the connection pool. Item: emit pool utilisation and pool wait time as first-class metrics on the service dashboard, so the next responder starts where the problem is.
- Minutes 35 to 80, mis-scoped mitigation. Restarting application instances briefly drained the pool and made the graphs recover, so the team believed it was fixed and stopped investigating until latency came back. Item: write down "a mitigation that works twice and fails the third time is not a fix" as an explicit escalation trigger, because a partial mitigation that keeps working is more dangerous to a timeline than one that plainly fails.
- Minutes 80 to 150, cross-team diagnosis. Identifying the downstream DNS change required the network team, who were not engaged until the second escalation. Item: add the network on-call to the initial page for any regional latency incident rather than waiting for the application team to rule itself out first.
- Minutes 150 to 180, recovery and verification. The rollback itself was quick; confirming recovery across every affected client was not, because the queries had to be written during the incident. Item: pre-build the "is it actually better yet" dashboard so verification is a glance.
The 6-minute detection gap still earns an item of its own, lower the alert threshold and add a connection-pool-exhaustion signal instead of relying on latency alone to catch it, but rank it honestly: it is the cheapest item on the list and worth at most 6 of the 180 minutes. The expensive time went into triage and cross-team engagement, and a review that bills its whole finding to detection has optimised the part that was already nearly free.
Trade-offs and pitfalls
Rushing to a single root cause when several factors usually combined is the most common mistake. Remediation items with no owner or date quietly die in the backlog. Treating the review as a courtroom instead of a blameless exercise teaches people to hide facts in the next incident, which is the opposite of what the review is for.
Unlock Full Question Bank
Get access to all Multi-Region and Geo-Distributed Systems interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.