Fintech Lab
Lesson 82Engineering deeperAdvanced
Multi-region replication for ledgers
Eventual consistency is fine for blog posts. It's not fine for double-spend prevention.

Your fintech scales beyond one region. A user in Lagos wants ledger reads from a Lagos-region replica (sub-100ms latency); a user in Nairobi wants the same from Nairobi. Easy enough for read replicas: stream WAL from primary to followers. But WRITES are tricky, you cannot allow two regions to independently post journal entries against the same user (double-spend on rebalance). The pattern: a SINGLE WRITE REGION (the primary), READ REPLICAS in other regions for low-latency reads. Writes must go to the primary even from Nairobi, taking the cross-region latency hit. Or: SHARD by user-id so each user lives in ONE write region and reads from the local replica. This lesson posts a write that flows through the primary-write topology.

Fintech Lab is a free, interactive lab for fintech engineers. Real ledger, your own sandbox, engineering patterns from production. See all 85 lessons.

Search lessons

Type to find any of the 85 lessons. Press Enter to open.