
Scaling ID Generation with Redis
It Started with a Simple Counter I work on a cloud-based document management platform used by large construction and engineering firms. Every document uploaded drawings, RFIs, approvals gets an unique ID following a tenant-defined schema: PROJ-9012-1001 │ │ │ │ │ └── Sequence number (auto-incremented) │ └──────── Document type identifier └──────────────── Project code An internal microservice called id-generator handled this. It worked fine for years, a closed system behind our portal, moderate traffic, no drama. Then we opened Public APIs so customers could automate their workflows. And the first large customer tried to migrate 200,000 documents in a single batch. The id-generator was called once per document, sequentially. Each call was a network hop. The migration ran for over six hours. The customer was not pleased. Why Sequential Doesn’t Scale: The Math A single ID generation involves a network round-trip to the id-generator (~100ms) plus the generator’s own processing and sequenc
Continue reading on Dev.to
Opens in a new tab



