Cross-Region Data Replication
One question, 3 costs
The prompt sounds operational: 'our warehouse is in Virginia, the new analytics team sits in Frankfurt, the dashboards feel slow, should we replicate?' Or it comes from compliance: 'EU customer data must stay in the EU, how does the global dashboard still work?' Either way the interviewer wants 3 costs separated and a number on each: round-trip latency, which physics sets; egress fees, which the cloud bill sets; and consistency, which your replication design sets. An answer that covers 1 of the 3 reads as incomplete in this round.
Latency: the speed of light is the floor
Light in fibre covers roughly 200,000 kilometres per second, so a round trip between the US east coast and Frankfurt, roughly 6,500 kilometres each way, costs about 65 milliseconds before any switch or server touches the packet, and measured round trips land between 80 and 100 milliseconds. Coast to coast across the US is 60 to 70 milliseconds, and US east to Singapore is 180 to 220. These figures matter in 2 ways. A query that makes 50 sequential round trips, which a chatty driver or an ORM will do, turns 90 milliseconds into 4.5 seconds. And a synchronous write that waits for a remote acknowledgement adds the full round trip to every commit, which is why synchronous cross-continent replication is reserved for small, critical state such as configuration and leader election.
| Route | Typical round trip | 50 sequential round trips |
|---|---|---|
| Same region, across zones | 1 to 2 ms | 0.1 s |
| US east to US west | 60 to 70 ms | 3.3 s |
| US east to Frankfurt | 80 to 100 ms | 4.5 s |
| US east to Singapore | 180 to 220 ms | 10 s |
Egress: the bill for every byte that leaves
Major cloud providers publish inter-region transfer prices of about $0.02 per gigabyte for most routes, with higher rates on some continents. The arithmetic is where the points are. Replicating 10 terabytes of raw events per day is 300 terabytes a month, which at $0.02 per gigabyte is roughly $6,000 a month in transfer alone, every month, before storage in the second region. The senior move is to ask what actually needs to cross. If the Frankfurt team consumes a 40 gigabyte daily aggregate, replicating that instead of the raw feed costs about $24 a month, which is 250x less. The latency complaint goes away too, because the data is now local to its readers.
- Replicate raw
- Every downstream query becomes possible in region 2
- Egress scales with event volume
- Lag of seconds with a log-based stream
- Doubles storage and doubles the compliance surface
- Replicate curated
- Only the agreed outputs cross the boundary
- Egress scales with aggregate size, often 100x smaller
- Lag equals the batch cadence
- A schema change in the aggregate is a cross-region contract
Consistency: what the other region sees
Asynchronous replication means the Frankfurt copy lags Virginia by some interval: seconds for a log-based stream, minutes to hours for a batch copy. The interviewer wants you to name the lag, name who notices it and name the rule that keeps it harmless. The rule is usually single-writer: 1 region owns writes for a given key and the others serve reads, so there is never a conflict to resolve. Where 2 regions must both write, you need a conflict policy, and last-writer-wins by timestamp is the common one, with the known flaw that clocks across regions disagree by milliseconds, so 2 updates inside that window resolve arbitrarily. Netflix has written publicly about running active-active across multiple regions and the replication work it demanded. The point to take from that material is that multi-writer is a product decision, worth its engineering cost only when the availability gain justifies it.
The residency twist
When the question comes from compliance, the direction reverses: data must stay in the EU, and the global view must be built from what is allowed to leave. The pattern is compute where the data lives and ship only the non-personal result: each region builds its own aggregates with the identifiers stripped out, and a global job unions them. This also answers the cost question, because the aggregates are small, and it sets up the next section, where the identifiers themselves are the subject.
- Latency: quote the round trip and multiply by the number of sequential calls
- Egress: quote the per-gigabyte rate, then the monthly bytes, then the product
- Consistency: quote the lag, the single-writer rule, and the conflict policy if there are 2 writers
- Residency: compute in region, ship only aggregates, union globally
About this lesson
This section is part of the How Data Moves: Advanced lesson on DataDriven, the home of data engineering. Lessons cover SQL, Python, Spark, data modeling and pipeline architecture, and each section pairs its explanation with worked examples and practice you run as you go.