High level:
Rohan Malhotra
Staff Engineer @ Orbitly | Distributed systems, Go, Postgres | Writing about architecture tradeoffs
High level:
1. Picked tenant_id as the shard key (every query already had it)
2. Built a routing layer in the app: tenant → shard lookup cached in memory
3. Logical replication to copy each tenant group to its new shard
4. Dual-read verification for a week (compare results, alert on mismatch)
5. Cut over tenant groups in batches during low traffic, with a 1-click rollback
Total: 4 months, 2 engineers. The dual-read week found 3 bugs that would've been incidents.
8 reactions3 comments
