Course contents
On this page
Decide which region may sell the last item
Place authority deliberately and use allocated stock rights when independent local sales are safe.
The shop serves buyers in Singapore and London. Product descriptions can be copied near both groups. Selling the last item is different: both regions must not independently treat the same unit as available.
Geographic design begins with this ownership question. A map of replicas does not tell us which region may make a binding decision.
Put the last item’s decision in one place
Suppose Singapore owns the stock record. A London request must reach that authority, unless the design safely transfers ownership. If the required round trip takes 180 milliseconds, an operation that waits for that trip cannot finish in 20 milliseconds merely because its local lookup is fast.
The 180 milliseconds is a hypothetical measured round trip, not a universal city-to-city value. A commit protocol requiring additional sequential trips may take longer. Replication placement also determines which failures an acknowledgment can survive.
Singapore owns the decision.
London must reach that authority or wait.
Singapore may sell six.
London may sell four.
Neither spends the other's rights.
Divide rights when the inventory permits it
With ten interchangeable units, allocate six selling rights to Singapore and four to London. Each region atomically decreases its own durable remaining rights when it accepts a purchase. It never sells below zero.
The total accepted sales cannot exceed ten as long as rights are neither duplicated nor independently recreated after a failure. During a network partition, both regions can continue within their allocations. London may sell out while Singapore still has stock; that temporary inability to use remote capacity is the cost of independence.
Transferring a right needs a protocol that prevents both regions from spending it. Likewise, a restarted region must recover its consumed-rights state before selling again. This is an application of the invariant and recovery reasoning already taught, not a workaround for it.
Predict an asymmetric burst
Singapore has sold two of its six allocated units. London has sold all four of its units and receives another buyer during a partition. Four units remain globally. Can London sell one without contacting Singapore or following a previously agreed transfer rule?
Count local rights rather than global leftovers
No. London’s allocation is exhausted. Assuming that unused rights elsewhere are available locally would allow two regions to spend the same rights. It must wait, refuse, or use a safe mechanism established before the partition. A displayed global stock estimate does not grant authority to sell.
Different operations can therefore have different geographic paths: nearby copies for descriptions, local rights for divisible inventory, and coordinated authority for indivisible decisions.
Further study: Spanner’s original paper shows another approach to geographically distributed transactions. The allocated-rights example here is a separate model, not a description of Spanner’s implementation.
Extended reference
The extended chapter preserves the original technical coverage, additional examples, and citations. The explanation above supplies the concepts needed for this page; the reference develops the specialist cases.
Find a section from the original chapter
- Learning outcomes
- A global user base does not require every decision to be global
- Regional ownership
- Replica placement and write paths
- Global reads and freshness
- Data residency and access boundaries
- Quotas and independent rights
- Failover and degraded geography
- Historical and current case connections
- A geography diagram needs three kinds of arrows
- Distance imposes a physical floor
- Regional ownership as a directory problem
- Bounded staleness needs evidence
- Allocate rights when the invariant permits it
- Failover placement changes the user journey
- Data movement is broader than table placement
- A worked decision for a global marketplace
- Geography as a correctness and UX decision
- A geographic latency table for one operation
- Design conclusion
- Sources and further reading