Last updated
Snowflake ID Capacity Limits
- Timestamp: 41 bits = ~69 years from epoch before overflow
- Datacenter IDs: 5 bits = 32 unique datacenters
- Worker IDs: 5 bits = 32 workers per datacenter
- Sequence: 12 bits = 4,096 IDs per millisecond per worker
- Total throughput: 4,096 × 1,024 workers = ~4.2 million IDs/ms
All ID generation happens entirely in your browser. Generated IDs are never transmitted to any server.
Examples
Example 1: Generate a Single Snowflake ID
Configuration:
Epoch: Twitter (2010-11-04 01:42:54 UTC)
Datacenter: 1
Worker: 3
Generated ID: 1529877576591609861
Decoded:
Timestamp: 2022-05-26 18:00:00.123 UTC
Datacenter ID: 1
Worker ID: 3
Sequence: 5
Example 2: Bulk Generation for Database Seeding
Configuration:
Epoch: Custom (2024-01-01 00:00:00 UTC)
Worker: 1
Count: 10
Generated IDs (time-ordered):
1000000000000000001
1000000000000000002
1000000000000000003
1000000000000000004
1000000000000000005
1000000000000000006
1000000000000000007
1000000000000000008
1000000000000000009
1000000000000000010
These IDs sort chronologically when sorted numerically.
Use them as primary keys in your test database.
Example 3: Multi-Worker Simulation
Simulating 3 workers generating IDs simultaneously:
Worker 1 (datacenter=1, worker=1):
1529877576591609857
1529877576591609858
1529877576591609859
Worker 2 (datacenter=1, worker=2):
1529877576591613953
1529877576591613954
1529877576591613955
Worker 3 (datacenter=1, worker=3):
1529877576591618049
1529877576591618050
1529877576591618051
All IDs are unique despite being generated at the same
millisecond. The worker ID bits ensure no collisions.