Sortable ids without a counter
Difficulty 4 of 5
Apps in 3 regions need 100,000 new ids/s. Ids must be unique and sort by creation time to within 1 s. Each id needs p99 under 20 ms, under 0.1 percent errors, at most 80 USD/mo. The clock in one region runs 300 ms ahead.
Fencing tokens · lease 30 s · late write with token 33: rejected
Goals and limits
- Duplicate IDs
- none
- ID order error
- under 1 s
- p99 latency (*)
- under 20 ms
- Error rate (*)
- under 0.1%
- Monthly cost
- under 80 USD/mo
- Parts you can add
- Key-value store, Postgres, API server
- Part limit
- 7
- Traffic
- 33,334 req/s
Concepts
How players did
Player results load from the server.