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.

Published
Updated
Reading time
13 min read
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.

Acme Shop regional authority and failover
  1. EU customers and edge

    Serve public cache entries locally and route private EU journeys to their EU authority.

  2. EU authority

    Owns EU customer data and checkout writes.

  3. US customers and edge

    Serve public cache entries locally and route private US journeys to their US authority.

  4. US authority

    Owns US customer data and checkout writes.

  5. 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.

JourneyNormal destinationData authorityFailure behaviorMust not happen
Public catalogNearest healthy edge cache, then regional originVersioned catalog publisherServe approved stale public content brieflyCache a customer-specific price or session.
Signed-in accountCustomer's home regionEU for EU accounts; US for US accountsClear regional unavailable result if authority is unavailableSend EU account data to US for convenience.
Checkout writeCustomer's home primaryHome payment and order authorityUse a tested same-authority standby or stop acceptance safelyReplay or redirect an uncertain payment cross-region.
Order-status readHome-region read modelHome authority with replicated read modelShow freshness time or ask the client to retryClaim 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
Checkout failover must clear authority and capacity gates

A healthy endpoint alone is insufficient: failover proceeds only when the standby preserves US authority, deployment compatibility, and capacity headroom.

Download:PNGSVG
Representative routing decision output
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-14

4. 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.

  1. Confirm the EU and US authority map, deployment version, certificate, edge-to-origin identity, and standby capacity evidence.
  2. Establish baseline p95, error rate, cache-hit ratio, queue age, order acceptance, and payment-provider responses by region.
  3. Make the US primary's checkout journey health check fail in the approved exercise scope only.
  4. Shift 10% of US checkout traffic to the US standby. Hold for the dwell period, then continue only if the success criteria hold.
  5. Verify EU account and checkout traffic never selects a US destination; verify US account data remains in the US authority.
  6. 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.
  7. Restore the US primary, wait for recovery hysteresis, and shift traffic back gradually. Preserve the evidence and decision log.
ValidationSuccessFailure signalRecovery evidence
US checkout shiftTest orders complete once; p95 and errors remain within objectiveDuplicate, uncertain, or failed order state; standby saturationPrimary is healthy for the recovery window and traffic returns in planned steps.
EU data authorityEU requests select EU authority onlyTrace or log shows an EU account request sent to USRemove the unsafe route rule, restore the last reviewed policy, and re-test.
Public catalog continuityApproved stale content is marked and origin load remains boundedMiss storm, stale content past policy, or origin overloadRestore cache policy or shield; purge only corrected keys.
ObservabilityOne trace connects edge, origin, data, and queue outcomeRegion or authority cannot be established from evidenceStop the exercise, repair telemetry, and rerun before approving failover.
Anycast catchment stabilityLong-lived connections either persist cleanly or fail with a retryable error the client handlesA connection stalls silently, or a checkout submits twice after a catchment changeAdd session draining or client-safe retry semantics before relying on anycast for that route; escalate the underlying BGP change with the network team.

Troubleshooting

SymptomLikely causeSafe checkRecovery
Traffic returns to primary and immediately fails over againHealth check has no recovery hysteresisCompare check history with steering eventsAdd consecutive-success and minimum-dwell requirements before retrying.
Standby receives traffic but checkout failsDependency, deployment, or quota parity is missingRun the approved synthetic checkout and inspect dependency healthHalt the shift, restore the primary route, then fix the missing prerequisite.
EU request appears at a US serviceRoute policy uses proximity instead of authorityInspect sanitized trace attributes for route and authorityDisable the route change, restore the reviewed residency policy, and assess exposure with privacy counsel.
Origin load spikes after a regional shiftCache keys differ, shield is bypassed, or cache is coldCompare cache hit ratio and unique keys before and after shiftPause further shift, restore cache consistency, and warm only public paths.
DNS change has no immediate effectRecursive resolvers retained the previous answerCompare resolver responses and edge traffic distributionUse the edge emergency route for confirmed outages; allow DNS caches to converge.
Incident outlasts the authoritative-side fixResolvers cached a resolution failure (SERVFAIL) for the negative-cache windowCheck authoritative DNS availability history against the negative-cache TTLTreat 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 networkAnycast catchment changed mid-session and later packets landed on a node without connection stateCorrelate client network path or ASN with the stalled request's timingAdd connection draining or safe client retry for long-lived connections on anycast routes.

Authoritative references

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