Skip to the content.

❄️ What is a Snowflake ID?

A Snowflake ID is a unique, time-ordered identifier (usually a 64-bit integer) generated in a distributed system without collisions.


🧩 Structure of a Snowflake ID (64 bits)

A typical Twitter Snowflake looks like this:

| 1 bit (unused) | 41 bits timestamp | 10 bits machine ID | 12 bits sequence number |

👉 This guarantees uniqueness across the whole distributed system.


🎯 Why Snowflake IDs are useful

  1. Globally unique across data centers.
  2. Time-ordered (newer IDs are larger numbers → useful for sorting).
  3. No central bottleneck like database auto-increment.
  4. Scalable → can generate millions of IDs per second.

🔍 Example

Let’s say a ride-hailing system wants to generate ride IDs without depending on a central DB:

Example (Discord Snowflake):

419430400000000000

From this, you can decode → timestamp, server ID, sequence.


🚀 Alternatives


👉 So in short: A Snowflake ID is a distributed, time-ordered unique identifier (64-bit integer), invented by Twitter, widely used in modern systems for scalable ID generation.