There's a BETTER alternative to UUIDs?! #python #coding #howto

preview_player
Показать описание
If you want to see more of me, join my Discord server!

I get a lot of people asking, so here's my setup!



If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.

#python #coding #howto
Рекомендации по теме
Комментарии
Автор

Don't store UUIDs as strings, they're in hex, covert to bytes and store them as blobs or using a uuid type. 128 bits now fits in 128 bits.

johnlockman
Автор

I had a project where the results of chained calculations were stored with an index of the XOR product of the component UUID4s. Which (1) had a hilarious side effect when one customer hired a different firm to reverse engineer where the calculated values corresponded to and (2) had a hilarious side effect when suddenly we were sourcing our data from a system that wasn't making UUIDs randomly but incrementally...

forgottenfamily
Автор

Snowflakes is where it's at for anything where you don't care if the user can see them. It takes a little more architecture since you need a worker to generate snowflakes. But they're unique, store a timestamp, and an incrementing int64 making them space efficient and you can use them as your IDs in database and still do sorting, filtering, sharding, etc.

The only pain is using them with JavaScript because JavaScript can't handle numbers that large 💀

fletchercutting
Автор

I’ve never seen the end line r before. Pretty dope

WhereRickyTanAt
Автор

I know they arent as cryptographicly strong but cant uuidv1 also encode dates?

nathansavage
Автор

Suggesting a solution over another one without mentioning contexts?!
I like your other videos.

Geza_Molnar_
Автор

Are UUID incremental? From what I know, UUID4 have great cryptographical properties (in comparison to uuid3 or 5). This is one of the reasons for using it.

I don't know if this ID is filling this need

divad
Автор

Are ULID compatible with postgres or how do i use them in Databases.

djtoon
Автор

Uuids never made sense, so many ways to make unique identifiers.

yahoolane
Автор

Why not just store a timestamp? I don't see the practicality of this.

cyrus
visit shbcf.ru