LOAD-BEARINGfree
High-level designTier 12 · unit 11 of 11 · 15 min read

Data residency and the isolated region

Lesson 12.07 established the principle: residency is a property of a data class, not of a company. This lesson is about what honouring it does to an architecture, because "keep Indian users' data in India" is one sentence that reorganises the whole system — and it is the requirement most often agreed to in a sales call and discovered by engineering a year later.

Three words, used interchangeably, meaning different things

  • Residency — a copy must exist in a particular place. Satisfiable by choosing a region.
  • Localisation — a copy must exist there and may be restricted from leaving. Now it is about your replication and backup topology too.
  • Sovereignty — the data is subject to that jurisdiction's law and shielded from others'. This one is frequently a claim about who can be legally compelled to hand it over, which is a question about the operator rather than the location, and therefore cannot be answered by picking a region at all.

Find out which of the three you have been promised before designing for it. They have wildly different costs and the contract usually says only "stored in".

The shape: per-region stacks, and a routing decision that comes first

Each region owns the primary store for its regulated classes. A request therefore has to be routed to the region that owns that subject before it touches any storage, which means you need a mapping from subject to home region that is globally readable, fast, and — critically — not itself regulated. So it holds an identifier and a region code and nothing else: no name, no email, nothing that would make the lookup table the very thing it is helping you protect.

The cheap version of this, available only on day one, is to make the identifier carry its own home region. Then routing is a function of the id rather than a lookup, and there is no global table to keep available.

What breaks, specifically

  • Global search and analytics. You cannot build one index across regions over rows that may not leave. The options are per-region indexes with fan-out and merge — which means search results legitimately differ depending on who is asking — or exporting only aggregates chosen so the derived numbers are not personal data.
  • Support and admin tooling. Your support team in one country can no longer open a record from another. Access becomes a per-region grant, and "let me just look at the row" stops being available to the people whose job it is to look at rows.
  • Backups and disaster recovery. A backup is a copy, so a cross-region backup is a cross-border transfer. Staying inside one jurisdiction means your DR story for regulated data is multi-zone within a region rather than multi-region — which lowers the ceiling on Lesson 14.01's RPO and RTO for precisely the data you care most about. That is a real reduction in resilience, traded for compliance, and it should be written down as such.
  • Anything spanning two subjects in different regions. A shared document, a transfer between accounts, a group chat. There is no transaction available, so it becomes an application-level merge with the saga machinery of Lesson 6.05.

Deletion turns into a distributed problem

An erasure request has to reach every copy: the regional primary, its replicas, its backups, the search index, the cache, the warehouse, the change stream that Lesson 7.06's pipeline retained, and whatever extract an analyst took last quarter. This is the obligation most systems cannot actually meet, and the reason is never the database — it is that copies were created by pipelines nobody kept an inventory of.

Retrofitting is a rebuild, not a migration

Adding residency to a system with one global database means the jurisdiction becomes the shard key, the identifier space has to encode a home region, and every read path grows a routing hop. Lesson 14.03's strangler and dual-write choreography still applies, but be honest in the estimate: this is the most expensive requirement in this tier, and its cost is set almost entirely by how early you knew about it.

The trap

Getting the primary store right and forgetting the derived copies. The database is correctly in-region, and then the logs go to a global aggregator, the metrics carry user identifiers, the error tracker captured a request body containing an address, the CDN logged the path with a name in it, and the support tool cached a profile. Every one is a copy, every one was added by a different team for a defensible reason, and an auditor counts all of them. Inventory the copies rather than the databases — and start with the observability stack, because it is the system in your estate specifically designed to collect everything and ship it somewhere central, which is the exact behaviour the requirement forbids.