3 ms·
You Don't Need UUID, But You Probably Want It: - Don't invent your own ID datatype (especially 11 byte one), this is almost guaranteed to cause dangerous bugs,
by pphysch 3y ago
You Don't Need UUID, But You Probably Want It:
- Don't invent your own ID datatype (especially 11 byte one), this is almost guaranteed to cause dangerous bugs, because each integration will have to carefully implement/hack it.
- Use UUID (preferably the new v7). 128-bit UUID is implemented, for you, pretty much everywhere.
- Serial integers still work too, but you should choose them consciously to fit the data model.
- Implement "natural keys" if you want pretty/memorable/Cool URLs. Never use non-standard PKs to store custom semantic data, because inevitably you will get garbage PKs that need to be fixed, and migrating a PK value is extremely risky.