@greghogg5: Twitter Snowflake is a distributed unique ID generator system created by Twitter. It is designed to generate highly scalable and unique identifiers without using a centralized coordinator. The system outputs a 64-bit integer instead of a massive 128-bit random UUID string. The first bit of the 64-bit integer is always set to zero to ensure the number remains positive. The next 41 bits encode a timestamp in milliseconds based on a custom defined epoch. This time component allows the generated IDs to be naturally sortable in chronological order. The next 10 bits represent the machine identifier which allows up to 1024 unique server nodes. The final 12 bits represent a local sequence counter that increments for requests on that specific machine. This counter resets every millisecond to allow a single machine to generate 4096 unique IDs per millisecond. By combining these components distributed servers can generate unique IDs concurrently without any network collisions.

Greg Hogg
Greg Hogg
Open In TikTok:
Region: CA
Thursday 21 May 2026 16:03:12 GMT
49706
1973
42
74

Music

Download

Comments

lumpy2432
lumpy2432 :
You can’t sort them because all of producer 1 will be before producer two
2026-05-22 23:05:39
4
patabyte
Patabyte :
imo uuid7 is great for the vast majority of implementations
2026-05-22 20:00:48
12
aelorek
Olivero :
MongoID has those features from years
2026-05-23 06:17:34
3
at_at51
At🍗 :
Why not ULID?
2026-05-21 16:29:42
4
l1nd_vf
l1nd_vf :
Yes okay, but I stick to UUIDv7
2026-07-16 21:53:08
3
weaskhalifa
Mr. Bird Dirt :
What to use for machine id?
2026-05-23 03:44:14
0
demitrek
Demi :
Are the sequences really sequential outside of a machine? I think each machine keeps its own sequence count, otherwise it won’t be really scalable
2026-05-22 08:32:26
0
momoshiki.otsutsuk1
momoshiki.otsutsuki :
UUIDv8 is more flexible and allows you to embed your own data and keep robustness
2026-07-16 23:00:26
1
sevsouv
sevsouv :
Looks a lot like uuidv4 except on 64bits instead of 128
2026-05-22 12:27:18
3
sophie_sticated_nicole
Sophie :
2^10 machines handing out ids doesn’t seem like a lot at scale? Or at least I can see it being problematic
2026-05-23 16:42:08
1
saxy_offical
saxy_ official :
Requires coordination and clock sync between nodes.
2026-07-17 06:22:27
0
f123a456v789
Fav :
Why not just use uuid
2026-07-18 10:03:25
0
user3235079111411
user7286997473554 :
How can I use this?? You mean I can program this sequence into where and how?😭
2026-07-20 01:49:51
0
qobide
QoBi :
perfect? All depends on the context.
2026-07-18 08:42:58
0
ils.me.mario
Mario :
great content 🔥
2026-05-23 21:49:49
0
whatboutno00
Whatboutno :
Mongodb has also their OWN unique Id
2026-05-25 21:54:30
0
mrtimothy0
mr timothy :
glad to see you still doing 2013 unreliable FAANG theory content
2026-07-19 21:36:06
0
To see more videos from user @greghogg5, please go to the Tikwm homepage.

Other Videos


About