Sharding · Estimate

A Snowflake generator has a 12-bit sequence per millisecond. At most how many ids can one worker issue per second?

easy Estimation

Answer

About 4,096,000 ids/s per worker. In review, anything from 3,410,000 to 4,920,000 counts as right.

The worked estimate

2¹² = 4,096 ids per millisecond. × 1,000 ms = 4,096,000 ids/s, about 4 million. When the sequence runs out, the generator waits for the next millisecond.

Numbers: Numbers to know.

Review this in your daily deck All cards in Sharding