Loading...
We need to design a distributed unique ID generator without collisions with time-ordered IDs and high throughput.
The hardest NFR is guaranteeing global uniqueness at high throughput without bottleneck.
POST /ids
Request: {"count": n}
Response: {"ids": [<id1>, <id2>, ..., <idn>]
Errors:
400 - invalid count
429 - rate limited
IDs are returned as strings and the API is stateless.
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.