Challenge 4: A sharded relational ledger
The situation
The user ledger records every balance and every transfer, in one relational database with a standby. It has grown until the writes alone are more than its leader can take, so the leader is full and requests are dropped.
Traffic
30,000 requests a second.
| Operation | Share | Steps |
|---|---|---|
| Read | 70% | Read data |
| Write | 30% | Write data |
- Read70%Read data
- Write30%Write data
Data
A cache answers 85% of the reads that reach it.
What you are proving
Writes can outgrow any one machine: the ledger takes more writes a second than a single leader can, and keeps its transactions.
Rules
- The ledger stays in a relational database, and every write is stored in it.Moving money needs transactions: a transfer is stored whole or not at all.
- A CDN cannot answer these requests.Each balance belongs to one user, so no two users get the same response.
Builds on
Targets
- Serve all 30,000 requests a second
- At least 99.99% available, with no single point of failure
- At most 8,000 USD a month
- Every write kept in a relational database
- Any tier loses one instance: nothing dropped, no tier over 80% busy