Scrivio Interview library
ScenarioAdvanced6 min read · updated 13 November 2026

To improve resilience, a company moved its web tier into a second region 70 ms away, while the database and two internal services stayed in the first region. Requests served from the new region went from 120 ms to 600 ms at p50.

Explain where the time went, and how you would redesign so a second region helps instead of hurting latency.

Requests served from the new region still make several sequential calls back to the first region, where the database and two services live: six calls at a 70 ms round trip add about 420 ms, which matches the jump from 120 to 600 ms, and any new TCP plus TLS 1.3 connection adds about two more round trips. To make the second region help, each request must stay inside one region: replicate the data the web tier reads into the new region, send writes to the primary region in one coarse call or route write-heavy users there, collapse chatty calls into one that runs near the data, make cross-region work asynchronous, and choose the target model, active-passive or active-active, explicitly while measuring latency per region and per call.

Why this question is asked

Adding a second region is usually done for resilience, and it is easy to assume that it is at worst neutral for latency. When only the web tier moves and its dependencies stay behind, every call the web tier makes now crosses a 70 ms gap, and a page that was fast becomes slow. Interviewers ask this because it tests both latency arithmetic and multi-region design. In this answer, we will account for the 480 ms, look at the connection cost, and redesign so each request stays in one region, ending with the choice between active-passive and active-active.

1Where the Time Went

Before the move, the web tier, the database and the two internal services were all in one region, a fraction of a millisecond apart. A request made, say, six sequential calls (a session lookup, two database queries, a call to the pricing service, another query, a call to the inventory service), each adding about a millisecond of network time. The 120 ms p50 was mostly the work itself.

After the move, the web tier in region B still makes the same six calls, but each one now crosses to region A and back. At a 70 ms round trip, six sequential calls add 6 times 70, about 420 ms. Add that to the original 120 ms and we get about 540 ms; a few more from slower connection setup brings us to the observed 600 ms. The arithmetic matches closely enough that we can be confident this is the cause.

Step throughOne request served from region B
UserWeb tier (region B)Services and DB (region A)
GET /product/42
session lookup (+70 ms)
product query (+70 ms)
price call (+70 ms)
stock call (+70 ms)
reviews query (+70 ms)
recommendations query (+70 ms)
page after about 600 ms

8 messages in order. Play them, or step through them one at a time.

Each arrow to region A is a full 70 ms round trip; six in a row add about 420 ms.

2New Connections Make It Worse

If any of those calls opens a new connection, it pays for handshakes before the request: one round trip for TCP and one for TLS 1.3, so 140 ms extra across this gap before the first byte of the request is even sent. Database drivers, HTTP clients and Redis clients that open connections per request or close idle connections quickly turn a 70 ms call into a 210 ms one.

So, even while the architecture is being fixed, connection pools across regions must be warm and reused: minimum idle connections kept open, keep-alive timeouts longer than the idle gaps, and HTTP/2 where possible so many requests share one connection. This is a quick win, but it does not remove the fundamental six round trips.

3Fix 1: Keep Each Request Inside One Region

The real fix is that a request served in region B should not need region A on its critical path. For reads, that means the data the web tier reads must also be in region B. We add a read replica of the database in region B, using PostgreSQL streaming replication or a managed equivalent, and deploy the two internal services there too, reading from the local replica. Reads then cost local round trips again.

Writes are harder, because with a single primary database every write must reach region A. We have two options. We send each write as one coarse call to region A, paying one 70 ms round trip instead of several. Or we route users who are doing write-heavy work, such as checkout, to region A entirely, so only read-mostly traffic is served from region B. Many sites combine both: browsing in the nearest region, transactions in the primary one.

4Fix 2: Collapse Chatty Calls and Go Asynchronous

Where a request must still talk to region A, we make it one conversation instead of six. A coarse endpoint in region A, sometimes called a backend-for-frontend, takes the whole request ('render product 42 for user 7'), makes the six calls locally at sub-millisecond cost, and returns everything in one response. The cross-region cost drops from six round trips to one.

And work the user does not need to wait for, such as recording a view for recommendations, updating analytics or sending an email, goes into a queue such as Kafka or SQS in region B and is consumed in region A later. Asynchronous work tolerates distance well because nobody is waiting for it.

Step throughRegion B after the redesign
  1. Users near region BServed locally for reads
  2. Web tierPooled, warm connections
  3. Internal servicesDeployed in both regions
  4. Read replica and cacheReplicated from region A, seconds behind
  5. Writes and async eventsOne coarse call or a queue to region A

5 layers, from the top down. Step through them one at a time.

5Fix 3: Decide the Target Model Explicitly

The original move was made for resilience, but it is not clear what kind. We should decide. In active-passive, region A serves all traffic and region B is a warm standby with replicated data, ready to take over in a failover; latency is unaffected in normal operation, and region B helps only during a regional outage. In active-active, both regions serve users, which helps latency for users near region B but requires local data in both regions and a plan for writes, either a single primary with the costs above or multi-primary databases that must resolve conflicts.

Whichever we choose, we measure latency per region and per call before and after each change, using distributed tracing, so we can see exactly which calls still cross the gap. Rolling the changes out in steps, starting with the replica and local reads, shows the improvement of each one.

6Follow-up questions

Which data would you replicate first, and how stale may it be?

The data read on almost every request and changed rarely: the product catalogue, prices for display, configuration, and user profiles and sessions. These can tolerate seconds of staleness, and replication lag across 70 ms is usually well under a second. I would not serve from a stale replica anything where a stale read causes harm, such as stock levels at the moment of purchase, account balances or a user reading their own just-made change, which should be read from the primary or with read-your-writes routing.

How do we handle a user reading their own write from the replica?

We remember, for a short time after a write, that this user must read from the primary, for example with a cookie holding the write's timestamp or log position, and route their reads to the primary until the replica has caught up past it.

Would a global database like Spanner or CockroachDB solve this?

They make multi-region data easier to manage, but a strongly consistent write still needs a round trip to a quorum across regions, so write latency stays high. They help most when data can be placed in the region where it is used.

7Conclusion

In this answer, we found that the 480 ms came from six sequential calls crossing a 70 ms gap, with new connections adding more. We kept connection pools warm as a quick win, then redesigned so each request stays in one region: a local read replica and services in region B, writes as one coarse call or routed to the primary region, chatty calls collapsed into one, and non-urgent work made asynchronous. We finished by choosing active-passive or active-active explicitly and measuring per region and per call.

What to say in the interviewAbout 90 seconds aloud

Open with

The web tier moved but its dependencies did not, so every request now crosses the 70 millisecond gap several times. If a request makes six sequential calls to the database and the two services, that is six round trips, about 420 milliseconds, which on top of the original 120 is very close to the 600 we see.

Then, if they want more

New connections make it worse, because TCP plus TLS 1.3 costs two more round trips before the request is sent, so first I would make sure connection pools across regions are warm and reused. But the real fix is to keep each request inside one region.

I would put a read replica of the database and instances of the two services in the new region, so reads are local again, accepting that the replica is a second or less behind. Writes go to the primary in one coarse call, or I route write-heavy flows like checkout to the primary region.

Where we still need the first region, I would collapse the chatty calls into one coarse endpoint that runs next to the data, and anything the user does not wait for goes through a queue asynchronously.

And I would make the model an explicit decision, active-passive for resilience only, or active-active for latency too, and measure latency per region and per call with tracing at each step. I would replicate the catalogue, profiles and sessions first.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Explain where the time went, and how you would redesign so a second region helps instead...": https://scrivio-interview-library.netlify.app/architecture/sd-fundamentals/eb1559f2a5/