2 ms·
1. 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 data
by marcus_holmes 8y ago
1. 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.