3 ms·
What’s a use-case for a v7 UUID vs using a v4 UUID which is entirely random based? Is it just that v7 includes a timestamp for better sorting?
by nodesocket 3y ago
What’s a use-case for a v7 UUID vs using a v4 UUID which is entirely random based? Is it just that v7 includes a timestamp for better sorting?
- vlucas 3y agoYes. UUIDv7 can be sorted by default in order of creation, which helps reduce fragmentation problems of randomness over time.
- guptaneil 3y ago> Is it just that v7 includes a timestamp for better sorting? Correct. The sortable nature of UUIDv7 improves database performance and index locality by helping the index be more efficient since rows are inserted in a predictable order instead of scattered randomly.
- mrits 3y agoIf nothing else (and there is plenty of else) it saves a lot of time knowing the order something was created when debugging.