Design a lightweight, highly available distributed unique ID generation service that outputs 64-bit numerically sortable IDs without cross-network lock contention.
Microservices requesting unique primary keys before performing database inserts.
Stateless worker nodes generating 64-bit integer IDs using local millisecond time & sequence counter.
Registers worker instances and assigns unique 10-bit Worker IDs (0 to 1023) at startup.
Calls local or embedded Snowflake worker.
Assemble 64-bit ID: (timestamp << 22) | (worker_id << 12) | sequence
ID returned in < 0.1ms without network locks.