2 ms·
Why do you use UUID's for keys? Unless you have many data sources which you need to aggregate using a 64-bit autoincremenet key is probably the best solution. 6
by jeltz 8y ago
Why do you use UUID's for keys? Unless you have many data sources which you need to aggregate using a 64-bit autoincremenet key is probably the best solution. 64-bits is enough for almost everything. They can be worth using if you have many data sources, but otherwise not really.
- marcus_holmes 8y ago1. I have parallel processes that create records on the same table at the same time. 2. In some cases, I want to create the key in code and send it to the database, rather than fetching the key after the insert. 3. I want to know that if I mess up and send a document_id where I meant to send a user_id and vice versa, it's going to report "no match" rather than create a security breach by exposing one user's records to another user. that's the main reasons anyway
- larkost 8y agoAnother common reason is that on distributed databases you often don't want your data stored in the same chunk/shard as the last one. You want to spread out your writes. This of course is not good design if your access patterns involve a lot of sequential reads, so you have to be aware of what you are going to do.
- deleted 8y ago[deleted]