Software architecture guide
Global Edge Architecture: Routing, Caching, Origin Resilience, and Scale
A global edge is a measured delivery system: route on capability, keep data authority explicit, and rehearse regional failure before an emergency makes the choice for you.
On this page
A nearby point of presence improves delivery latency; it does not make a distant, saturated, or inconsistent data authority disappear. Global edge architecture therefore begins with user journeys and states where each read, write, and failover decision is allowed to happen. At the scale a managed edge-orchestration layer runs at — dozens of routes, several provider networks, and two or more authoritative regions — that discipline only holds if it is enforced the same way everywhere and observed from one place; otherwise the fastest edge in the world will still fail over into the wrong region.
Overview
Outcome
Build a provider-neutral EU and US delivery plan with clear data authority, safe public caching, capacity-aware failover, and evidence that a regional recovery preserves the intended user journey.
Overview
Prerequisites
- Regional p95 latency, availability, and capacity objectives for public pages, account, and checkout.
- A route map that identifies cacheable reads, private reads, and authoritative writes.
- Two tested origin regions with certificates, edge-to-origin authentication, and equivalent deployment versions.
- Synthetic and real-user telemetry segmented by region, route, cache status, and selected origin.
Scenario: Acme Shop serves EU and US customers without moving authority by accident
Acme Shop uses regional edge delivery and public catalog caches in Europe and the United States. EU customer-profile data remains in Acme's EU authority; US profile data remains in the US authority. Product catalog reads use regional replicas with a disclosed freshness target. Checkout writes always go to the customer's home authority. During a US application-region outage, Acme can serve public catalog pages from cache and can fail US checkout only to a prevalidated US standby that has the required payment and data dependencies. It does not fail US personal data to Europe merely because Europe is healthy. Acme also treats its authoritative DNS and its edge-level traffic steering as two different control planes with two different recovery speeds: the edge absorbs a single site's failure in seconds, while moving an entire region to a different network or provider is a slower, reviewed DNS change.
- EU customers and edge
Serve public cache entries locally and route private EU journeys to their EU authority.
- EU authority
Owns EU customer data and checkout writes.
- US customers and edge
Serve public cache entries locally and route private US journeys to their US authority.
- US authority
Owns US customer data and checkout writes.
- US standby
Receives US checkout traffic only after compatibility and capacity checks pass.
EU and US edges serve local public cache entries. Reads use approved regional replicas; checkout writes stay with their home authority and only fail over to a validated compatible standby.
1. Publish a global edge architecture routing and data-authority table
DNS is a slow control plane because resolvers retain answers beyond a change. Use it for stable entry and provider selection; use the edge for route-level decisions based on path, cache state, and validated application health. Document the route contract before configuring either layer.
| Journey | Normal destination | Data authority | Failure behavior | Must not happen |
|---|---|---|---|---|
| Public catalog | Nearest healthy edge cache, then regional origin | Versioned catalog publisher | Serve approved stale public content briefly | Cache a customer-specific price or session. |
| Signed-in account | Customer's home region | EU for EU accounts; US for US accounts | Clear regional unavailable result if authority is unavailable | Send EU account data to US for convenience. |
| Checkout write | Customer's home primary | Home payment and order authority | Use a tested same-authority standby or stop acceptance safely | Replay or redirect an uncertain payment cross-region. |
| Order-status read | Home-region read model | Home authority with replicated read model | Show freshness time or ask the client to retry | Claim a replica is current when it is not. |
If a route depends on residency or contractual processing commitments, encode that as a routing invariant and monitor it. IP geolocation is a delivery signal, not proof of a person's location or a lawful data-routing decision.
DNS carries a second, less obvious risk during an incident: resolvers are required to cache resolution failures, not just answers. If an authoritative name server becomes briefly unreachable, a recursive resolver can hold that failure for the duration of its negative-cache window, which extends an outage past the moment the authoritative side actually recovers, and can drive a large retry storm onto the wider DNS system when many resolvers re-query at once (RFC 9520). Treat the availability of the authoritative DNS path itself as a monitored dependency, distinct from the records it serves.
2. Choose a global traffic routing method: anycast, DNS steering, or both
Two different mechanisms actually move traffic globally, and they fail on different timescales:
- DNS-based steering changes which address a resolver hands back. It is simple to reason about and works for any transport, but a change only takes effect as resolvers expire their cached answers — typically minutes, longer if a resolver misbehaves or caches a resolution failure as described above. Lower a record's TTL before a planned change, not during an incident; a TTL lowered after resolvers already cached the old value has no retroactive effect.
- Anycast routing advertises the same address from every edge site and lets BGP deliver each packet to a topologically close, healthy site. Convergence after a withdrawn route is usually seconds rather than minutes, which is why most CDN and DNS-resolver networks run anycast underneath their global traffic routing. The tradeoff is mid-session re-routing: if BGP reconverges during a long-lived connection such as a WebSocket, later packets can land on a site with no record of that connection's state, breaking it even though every individual hop "succeeded" (RFC 4786).
Acme uses both, deliberately, and does not let one stand in for the other. Anycast at the edge layer gives it sub-second protection against a single site failing. DNS-based provider selection is reserved for the slow, reviewed decision to move a region's entry point to a different network or provider. A BGP-level failover never gets to make a data-authority decision; that stays governed by the table in the previous section.
3. Budget capacity before moving traffic
Failover is a capacity decision. If the primary receives P requests/s, the standby must support the traffic share it will receive plus headroom for cache misses and recovery work:
required standby capacity = P x failover share x (1 + headroom)
For 800 checkout requests/s, a 50% planned shift, and 30% headroom, Acme validates at least 800 x 0.5 x 1.3 = 520 requests/s of safe standby capacity. Validate database pools, payment-provider quotas, connection limits, TLS, WAF/rate policies, and queue workers at the same time. A healthy HTTP listener without those dependencies is not a failover target.
route: /checkout
primary: us-east-authority
standby: us-central-authority
steering:
trigger: journey-health-check
unhealthy-after: 3 consecutive failures
shift: 10 percent every 5 minutes
minimum-dwell: 15 minutes
recovery: 3 consecutive healthy checks plus capacity review
guards:
required-deploy-version: checkout-2026-07-14
required-data-authority: US
direct-origin-access: denied
A healthy endpoint alone is insufficient: failover proceeds only when the standby preserves US authority, deployment compatibility, and capacity headroom.
trace_id=4bf92f... route=/checkout client_region=US
selected_origin=us-east-authority steering=primary
authority=US cache_status=BYPASS
health=healthy deployment=checkout-2026-07-144. Design public cache layers for origin resilience
Keep browser, edge, shield, and application caches distinct. Acme caches only public catalog representations, with a key based on normalized path, approved locale, and documented variant. It uses request collapsing at the shield so an expiry does not create hundreds of identical origin fetches.
At an edge hit ratio H, a public route at R requests/s sends roughly R x (1 - H) initial requests/s upstream. The calculation is a planning baseline, not permission to exceed origin concurrency. A cold cache, purge, or routing shift reduces H, so test those events at the expected traffic distribution.
Origin resilience also comes from what the cache is allowed to do when the origin is slow or failing, not only from the hit ratio. Acme's catalog responses carry Cache-Control: max-age=120, stale-while-revalidate=300, stale-if-error=3600. stale-while-revalidate lets the edge serve the last fresh-enough copy while it revalidates in the background, hiding origin latency from the customer; stale-if-error lets the edge keep serving that last good copy for up to an hour if the origin starts returning errors, which is the directive that actually protects a page during an origin incident. Both are part of RFC 9111 and only help if every layer between edge and browser honors them — a shield, application cache, or intermediate proxy that strips or ignores the directive silently removes the protection it was meant to provide.
One cache and health policy across every provider
If Acme adds a second edge provider for redundancy, the risk is not the provider itself — it is cache-key, TTL, and health-check drift between providers producing two different answers to "is this page cacheable, and is the origin healthy." Orchestrating one cache and failover policy across providers, and watching hit ratio, staleness, and origin load through a single view such as MYO, is what keeps a provider-neutral edge from becoming a provider-inconsistent one.
Private account, order, authorization, and checkout responses are not shared-cached. The origin denies direct traffic, accepts only the trusted edge connection, and replaces client-supplied forwarding headers.
5. Exercise a US failover without violating EU authority
Use a controlled test window and a non-destructive checkout test transaction. Do not simulate failure by disabling broad security controls or by sending unsafe traffic.
- Confirm the EU and US authority map, deployment version, certificate, edge-to-origin identity, and standby capacity evidence.
- Establish baseline p95, error rate, cache-hit ratio, queue age, order acceptance, and payment-provider responses by region.
- Make the US primary's checkout journey health check fail in the approved exercise scope only.
- Shift 10% of US checkout traffic to the US standby. Hold for the dwell period, then continue only if the success criteria hold.
- Verify EU account and checkout traffic never selects a US destination; verify US account data remains in the US authority.
- If any leg of the path uses anycast, watch for catchment changes during the shift — a site announcing or withdrawing a route mid-test can re-home in-flight, long-lived connections to a node with no session state. Confirm the client-visible effect is a clean retry, not a silent stall or a duplicate submission.
- Restore the US primary, wait for recovery hysteresis, and shift traffic back gradually. Preserve the evidence and decision log.
| Validation | Success | Failure signal | Recovery evidence |
|---|---|---|---|
| US checkout shift | Test orders complete once; p95 and errors remain within objective | Duplicate, uncertain, or failed order state; standby saturation | Primary is healthy for the recovery window and traffic returns in planned steps. |
| EU data authority | EU requests select EU authority only | Trace or log shows an EU account request sent to US | Remove the unsafe route rule, restore the last reviewed policy, and re-test. |
| Public catalog continuity | Approved stale content is marked and origin load remains bounded | Miss storm, stale content past policy, or origin overload | Restore cache policy or shield; purge only corrected keys. |
| Observability | One trace connects edge, origin, data, and queue outcome | Region or authority cannot be established from evidence | Stop the exercise, repair telemetry, and rerun before approving failover. |
| Anycast catchment stability | Long-lived connections either persist cleanly or fail with a retryable error the client handles | A connection stalls silently, or a checkout submits twice after a catchment change | Add session draining or client-safe retry semantics before relying on anycast for that route; escalate the underlying BGP change with the network team. |
Troubleshooting
| Symptom | Likely cause | Safe check | Recovery |
|---|---|---|---|
| Traffic returns to primary and immediately fails over again | Health check has no recovery hysteresis | Compare check history with steering events | Add consecutive-success and minimum-dwell requirements before retrying. |
| Standby receives traffic but checkout fails | Dependency, deployment, or quota parity is missing | Run the approved synthetic checkout and inspect dependency health | Halt the shift, restore the primary route, then fix the missing prerequisite. |
| EU request appears at a US service | Route policy uses proximity instead of authority | Inspect sanitized trace attributes for route and authority | Disable the route change, restore the reviewed residency policy, and assess exposure with privacy counsel. |
| Origin load spikes after a regional shift | Cache keys differ, shield is bypassed, or cache is cold | Compare cache hit ratio and unique keys before and after shift | Pause further shift, restore cache consistency, and warm only public paths. |
| DNS change has no immediate effect | Recursive resolvers retained the previous answer | Compare resolver responses and edge traffic distribution | Use the edge emergency route for confirmed outages; allow DNS caches to converge. |
| Incident outlasts the authoritative-side fix | Resolvers cached a resolution failure (SERVFAIL) for the negative-cache window | Check authoritative DNS availability history against the negative-cache TTL | Treat authoritative DNS reachability as a monitored dependency and shorten negative-cache TTLs where you control them. |
| Checkout appears to hang mid-request on a specific network | Anycast catchment changed mid-session and later packets landed on a node without connection state | Correlate client network path or ASN with the stalled request's timing | Add connection draining or safe client retry for long-lived connections on anycast routes. |
Related guides
Authoritative references
- Google SRE Book: Addressing Cascading Failures
- Google SRE Workbook: Managing Critical State
- IETF RFC 9111: HTTP Caching
- IETF RFC 4786: Operation of Anycast Services (BCP 126)
- IETF RFC 9520: Negative Caching of DNS Resolution Failures
- Microsoft Azure Architecture Center: Deployment Stamps pattern
- OpenTelemetry semantic conventions
Orchestrate global edge architecture across every provider
Talk to Optimi about global traffic routing, origin resilience, and one MYO view across performance, security, and visibility for every region and provider you run.
Discuss global edge architecture