Home/Labs/Speed-of-Light Latency Lab
All 280 Labs
INTERACTIVE LAB🌍

Data Locality & Geo-Distribution Lab (Interactive)

Route a Sydney user to a Virginia origin and watch 200,000 km/s physics dominate every RTT you have not moved to the edge. Compute fiber roundtrips from real geography, then add edge CDN caching or local read replicas to shrink time-to-first-byte.

Speed-of-Light Latency Budget Planner

Photons in glass move at ~200,000 km/s. No optimization beats physics — only locality does.

User in
Origin in
Cable length27,185 km
15,991 km great-circle × 1.7 detour
One roundtrip272 ms
fiberKm ÷ 200,000 km/s × 2
Read TTFB1087 ms
above the 100 ms human perception wall
Write path1087 ms
every hop pays the ocean
A 4-RTT legacy handshake from Sydney to New York costs 1087 ms — nearly 1.1 s before the first byte of HTML. Terminate TLS at a local PoP and reuse warm origin connections.

How It Works Under the Hood

Light in silica fiber moves at roughly 200,000 km/s and subsea cables detour 1.5-2x beyond great-circle distance, so London-Sydney is a hard ~280 ms floor no code can beat. A legacy first visit pays four roundtrips — DNS, TCP, TLS, GET — nearly a full second before the first byte. Data locality defeats it from two directions: move data to users with 300+ edge PoPs running TLS termination and LiteFS or Aurora Global read replicas, or move compute to data for analytics workloads, while GDPR geo-partitioning constrains which users may get which replica.

Core Architectural Principles

  • Roundtrip ≈ fiber km ÷ 200,000 km/s × 2 — NYC-London ~75 ms, SF-Tokyo ~110 ms, fixed by physics.
  • Edge PoPs terminate TLS in ~4 ms locally and reuse pre-warmed private-backbone connections to origin.
  • Reads answer from local replicas in under 6 ms; writes forward asynchronously and accept ~1 s staleness.
Interview Round Script

Open global-latency questions with physics: "Light in fiber is 200,000 km/s, so Sydney to Virginia is a ~220 ms floor; I will terminate TLS at edge PoPs and serve reads from regional replicas." Close with GDPR geo-partitioning as a compliance driver, not just a performance one — that pairing is staff-level.

Key Trade-Offs

Edge locality buys sub-15 ms reads at the cost of replication lag, cross-region write complexity, and a multiple of single-region infrastructure spend.

Related Curriculum Chapter

Data Locality & Geo-Distribution

Read Full Chapter Blueprint

Explore More Interactive Labs

View All 280 Labs