Scrivio Interview library
LeadershipPrincipal7 min read · updated 12 November 2026

Your company plans to expand into three new regions over five years with data residency rules. How do you plan database capacity and topology at this horizon?

With residency rules, the law decides the topology before capacity does: each region gets its own data stores, and we write down exactly which data may cross a border. We build regions as repeatable cells from one template, so a new region is a copy rather than a project, keep only identity and billing global, model growth per region with a conservative and an aggressive scenario, and grow an on-call model that can follow the sun.

Why this question is asked

A five-year expansion into new regions is one of the few database decisions that is expensive to get wrong and slow to undo. If the first region is built by hand, the third one will take a year and will look nothing like the first. If customer data quietly flows to a central database, a regulator can force a redesign at the worst moment. Interviewers ask this at the most senior level to see whether we start from the constraints that cannot move (law and latency), then turn them into a repeatable architecture and a budget. In this answer, we will look at how residency rules shape the topology, how a cell architecture makes regions repeatable, how to split global from regional data, how to model capacity and cost over five years, and how the operations team has to grow with it.

1Start From the Rules That Cannot Move

Data residency means that some data about people or businesses in a country must be stored, and sometimes processed, inside that country or economic area. The rules differ: one region may only require that personal data stays at rest inside its borders, another may forbid copies outside it even for backups, and a third may allow transfers with contractual safeguards. Before drawing any diagram, we sit with legal and privacy colleagues and turn each rule into a plain statement about data classes, such as 'customer profiles and orders of EU customers are stored only in EU regions, including backups and replicas'.

So the first output of the planning is not a server count. It is a data classification table: for each class of data, where it may live, where its backups may live, and whether it may be read from elsewhere. That table decides the topology. Capacity planning only starts once we know which data has to sit in which place, because a design that is perfectly sized but stores data in the wrong country is simply not allowed.

Notice that residency also affects things engineers forget: logs, analytics exports, search indexes, caches, support tools and the replicas used for disaster recovery. A Redis cache in a central region holding EU customer names is a residency breach just as much as the main database would be.

Example data classification for residency
Data classWhere it livesMay cross borders?
Customer profile, ordersHome region only, backups in same areaNo, only aggregated or anonymised
Payment tokensHome region, provider vaultNo
Login identity (email hash, id)Global directoryYes, minimal fields
Billing totals per accountGlobal billing storeYes, under contract
Product catalogueGlobal, replicated to every regionYes, not personal data
Logs and tracesHome region, masked before exportOnly masked
The classification comes first; the topology follows from it.

2A Cell Architecture Makes Each Region a Copy

A cell is a complete, self-contained slice of the system: application services, databases, caches, queues, monitoring and backups, deployed together and serving a defined set of customers. In a regional design each region holds one or more cells. The key property is that a cell is built from a template, using infrastructure as code (Terraform or similar), standard database configurations and standard runbooks. Launching a new region then means applying the template with new parameters and running the same validation tests.

The reason this matters over five years is cost and risk. The first region might take six months, because we are building the template. If the template is good, the second and third should take weeks. Each region also limits the blast radius of failures: a bad migration or an overloaded database hurts one cell, not every customer in the world.

There is a catch: templates rot if regions are allowed to drift. We treat a manual change in one region as a defect and fold real improvements back into the template, so that every region runs the same PostgreSQL version family, the same parameter sets and the same backup policy.

Step throughOne regional cell
  1. Edge and routingsends each customer to their home region
  2. Application servicessame images in every region
  3. Regional databasesPostgreSQL primary plus replicas inside the region
  4. Regional backupskept in the same legal area
  5. Global servicesidentity directory, billing, catalogue

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

Everything above the last layer is copied per region; only the last layer is shared.

3Deciding What Must Be Global

Not everything can be regional. A person who logs in from a new country must be routed to the right home region, so we need a small global directory that maps a login to a region. Billing and finance often need a global view for reporting and invoicing. These pieces need strong consistency across regions, which is expensive: a write that must be agreed by servers on two continents costs tens to hundreds of milliseconds in network round trips alone.

So the rule we use is to keep the global part as small as possible. The directory stores an identifier, a home region and the minimum needed to authenticate, not the full profile. Billing receives totals and invoice lines that the contract allows to cross borders, not raw orders. Everything else stays regional and is eventually consistent with the global pieces through events. For the global stores we can choose a multi-region database or a single primary with replicas, depending on how much write latency the use case accepts.

4Modelling Capacity and Cost Over Five Years

At a five-year horizon nobody knows the exact numbers, so we do not pretend to. We build a simple model per region with two scenarios. The conservative scenario uses the growth we are fairly sure of; the aggressive one uses the business plan if everything goes well. The model turns business drivers (customers, orders per customer, data retained per order) into database figures: storage, write rate, peak connections, and the instance sizes needed to keep CPU below about 60 percent at peak.

For example, if a new region expects 200,000 customers in year one and 1.5 million in year five, at 40 orders a year and 5 KB per order including indexes, year-five storage is about 1.5 million x 40 x 5 KB, roughly 300 GB per year of orders, plus history. We then add headroom, replicas and backups. The conservative scenario decides what we commit to with reserved capacity or savings plans, because commitments are cheap only if we really use them. The gap up to the aggressive scenario is covered by on-demand capacity and by the ability to add cells.

We revisit the model every quarter with real figures. The point of the model is not to be right in year five; it is to make the assumptions visible so that finance, product and engineering argue about the same numbers.

Properties
customers_y5 = 1_500_000
orders_per_year = 40
bytes_per_order = 5 * 1024 # row plus indexes
yearly_growth_gb = customers_y5 * orders_per_year * bytes_per_order / 1024**3 # about 286 GB
with_replicas_gb = yearly_growth_gb * 3 # primary plus two replicas: about 858 GB of disk per year

5Growing the Team and the On-Call Model

Three new regions also means three new sets of business hours. If all database engineers sit in one time zone, the region on the other side of the world is supported at 3 a.m. by tired people. Over five years we plan the team to follow the sun: engineers in two or three time zones, a shared runbook set that works the same in every region (which the cell template makes possible), and clear rules for who is paged first.

Residency can also reach into operations. Some rules restrict who may access personal data, so support staff or engineers outside a region may need just-in-time access with auditing, or masked views only. We design those access paths early, because retrofitting them during an incident is how breaches happen.

6Follow-up questions

How do you handle a customer who moves between regions?

We treat it as a planned data migration. The customer's data is copied to the new home region, the directory entry is switched, and the old copy is deleted after a verification period, all with an audit trail. Because it is rare, it can be a careful batch process rather than a real-time feature, as long as the legal team agrees on how long both copies may coexist.

Would you use one multi-region database for everything instead of cells?

Usually not. A database that spreads every table across regions makes residency harder to prove, makes every write pay cross-region latency and ties all regions to one failure domain. A multi-region database can be the right tool for the small global pieces, such as the directory, while the bulk of the data stays in regional cells.

What do you commit to in year one?

We commit to the conservative scenario only, often for one year rather than three in a new region, because early forecasts are the least reliable. As real usage data arrives, we extend commitments for the steady base and leave the growth on flexible capacity.

7Conclusion

In this answer, we saw that residency rules come first and decide the topology through a data classification table. A cell architecture built from one template turns each new region into a copy rather than a project and limits the blast radius of failures. We keep the global part small, usually identity and billing, model capacity per region with conservative and aggressive scenarios that drive commitments, and plan an operations team and on-call model that can support every region in its own working hours.

What to say in the interviewAbout 80 seconds aloud

Open with

I would start with the constraints that cannot move, which are the residency rules. With legal, I turn them into a data classification: which data must stay in which region, including backups, logs and caches, and what may cross borders.

Then, if they want more

That decides the topology, so each region gets its own data stores. Then I make regions repeatable with a cell architecture: one template with infrastructure as code, standard PostgreSQL configurations, backups and runbooks, so launching the second and third region is applying the template, not a new project, and failures stay inside one cell.

I keep the global part deliberately small, typically a login directory that maps people to their home region and a billing store that receives only what the contract allows. For capacity I build a per-region model from business drivers, customers, orders and bytes per order, with a conservative and an aggressive scenario.

The conservative one drives reserved capacity and commitments, the gap is on-demand, and we revisit it quarterly with real numbers. Finally I plan the people side: on-call across time zones with the same runbooks everywhere, and access controls that respect residency during incidents.

About this answer

Last updated
12 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 documentation below. 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 "Your company plans to expand into three new regions over five years with data residency...": https://scrivio-interview-library.netlify.app/databases/database-operations/bb17741bcc/