UUID v7 vs. v4 + Rust Programming Examples

preview_player
Показать описание
Quick overview of UUID v7 vs. v4 with some Rust programming and various possible string encodings.

In short:
- UUID v4 is still great for when maximum entropy is needed, such as hashing salts and context-free IDs (e.g., context-free IDs for highly sensitive data).
- UUID v7 is great for database IDs, from single to distributed databases, and when a UUID with time adds value (millisecond precision).

Note on ULID: At the bit level, although developed completely independently, ULID can be seen as a precursor to UUID v7 and is very similar. The first 48 bits are designated for the time, and the rest for randomness. Thus, at the bit level, all UUID v7s are valid ULIDs, but the opposite is not true, as UUID v7 requires specific bits for the version and variant. ULID uses a different standard string serialization that employs BASE 32 to make it shorter while maintaining lexicographical ordering. This serialization is similar to the one we demonstrated in the video with base32hex.

== Jeremy Chone:

== Rust10x AI / OpenAI / Ollama

== Rust10x Web App production coding:

== Other

Other popular Rust Programming videos:

Playlists:

Other notes:

- ScreenBrush for the green lines. (Gromit seems to be the equivalent on Linux)
- Sketchapp for some graphics.
- Davinci Resolve and Fusion video editing.
- VSCode with Google Material icon themes (with some customization)
Рекомендации по теме
Комментарии
Автор

What a condensed and straightforward explanation that can actually be used in the real world.

kubre_in
Автор

Really good explanation on different techniques to store the uuids

SuperRoli
Автор

I wish you were my teacher for a lot of things. I would understand everything so easily and very fast . You are good 👌

weiSane
Автор

The content is as good as usually. The time format is perfect for me.

maxali
Автор

Straightforward & to the point, I like it 👍

jaimalad
Автор

TIL UUID v7 & base58. Especially loved the watch cmd and SEEING the 3 v7s lined up next to each other. Made sense before but grokked more fully when I saw the interactivity.

arisweedler
Автор

Thank you for sharing this, I learned a lot! 😊

ervinpm
Автор

Thanks always learn new concept from you

midewestmond
Автор

Really awesome! I'll need to keep this trick in mind

tqwewe
Автор

Thanks for making these. I didn't even know about the existence of V7.

Also, wonder what impact this will have on other tools such as snowflake, as the main critique of UUID was the database indexing part you said.

foklin
Автор

Thanks for explanation. Though I have 2 queries
1. Can we extract time stamp from v7 string to UTC format?
2. Do we have assurance, u4/u7 will always give totally unique string always? Do they maintain trace? I have fear of conflicting duplicate !

warriorblood
Автор

Jeremy what is your hardware, because your cargo-watch is really fast, I got impressed.

marcosdantas
Автор

if you want user-friendly id you can use cuid

CuriousSpy