Snowflake implementation in typescript
A distributed monotone incremented Identifier generate algorithm
timestamp | shardId | seqId |
---|---|---|
timestamp difference in millisecond(41bit) | shardId(10bit) | seqId(12bit) |
-
in 1 millisecond could generate 2^12 different id
-
if more than 2^12 request in 1 millisecond, this service will block this request