Earlier quoted context omitted.
> It seems like the only real use case for these timestamps is to get data from around the same time together. Yep. > A second is fine for that. Not when you're doing O(1k-1M) operations per second, it isn't!
I’d think that the locality would only matter at the scale of your query. I’m sure someone has queries with a window less than a second and so much traffic, but it seems niche enough to not optimize the standard for it. I could definitely be off. I work at a company that gets those levels of traffic but don’t deal with it directly.
Goodbye integers, hello UUIDv7
371–376 of 376 posts
Re: Goodbye integers, hello UUIDv7
#372Earlier quoted context omitted.
They’re not even strongly sequential (is there a term for this?). The gaps between them can be arbitrarily large.
They are sequential, where they are in a sequence where one is clearly before or after another. They're not monotonic.
Re: Goodbye integers, hello UUIDv7
#373Earlier quoted context omitted.
Sure you can, just prefix the encrypted identifier with a version number. https://app.example.org/file/1:abcdef12345 -> decrypt abcdef12345 with key "1" to yield UUIDv7 key of file (no matter what the latest key is)
An incrementing version number would once again leak time information. Even a not incrementing version number would leak that kind of information, because if you know the timestamp of another ID with the same version. I think there is no good alternative to random external identifiers.
Re: Goodbye integers, hello UUIDv7
#374Earlier quoted context omitted.
Unless you have specific needs, the only type of UUID you should care about is v4. v1: mac address + time + random v4: completely random v5: input + seed (consistent, derived from input) v7: time + random (distributed sortable ids)
It would seem sequential keys for database performance is more than a 'specific' need.
Generating sortable IDs in very high volume, in a distributed architecture, is a problem very specific to systems like social networks, metrics collection etc. You won’t need that for your average e-commerce app or machine parts database.
Re: Goodbye integers, hello UUIDv7
#375Earlier quoted context omitted.
UUIDs are 128 bits, or 16 bytes. They have infinitely many possible string representations. Those strings are not the value, they're a transformation of the value.
The strings are how HUMANS not machines interact with the UUID. When your java stacktrace spits out a log with an UUID it's going to spit out a STRING because it's written for you and not the computer. When you take that UUID and go start sniffing around internal systems you're going to copy the UTF-8 string representation.
Re: Goodbye integers, hello UUIDv7
#376As a beginner I treated and understood (SQL) databases as something I have to use in order to store stuff. Later I was excited about the power and expressiveness of SQL and its extensions. There is a ton of leverage and you can make it so that interfacing with it directly becomes much more useful. However now I’m in a different phase. I see it as a durable data structure. I think in terms of “what does it provide to…
As a beginner I thought of the database as a backend for the app. Now I think of the app as a frontend for the database. :-D