FWIW this isn’t true anymore with newer uuid schemes like v7 that are roughly time sortable.
Serial index forces a synchronisation point on every entity that can create records. If this is only ever a single database that’s fine but plenty of apps can’t scale this way.
Re:
by marcosdumay on Saturday February 10, 2024 @09:50AM
(#39326513)
They don't. Clustered databases deal with parallel generation of them just fine.
They require periodic synchronization. What isn't a big deal at all and is required by many other database features.
If you have a sharded DB, each instance can get its own range of ints, which are periodically refreshed.
PlanetScale uses int PKs [0], and they seem to have scaled just fine.
[0]: https://github.com/planetscale/discussion/discussions/366
Uuids are really for external communication, not in-system organization.