3 ms·
DB sequence will give you a unique ID before the transaction succeeds. If the transaction fails, there's just a gap in the IDs. If some service that doesn't in
by traderj0e 7mo ago
DB sequence will give you a unique ID before the transaction succeeds. If the transaction fails, there's just a gap in the IDs.
If some service that doesn't interact with the DB wants to define its own IDs, sure, but even then whatever writes to the DB can always remap that to serial IDs. I know there are use cases where that still doesn't make sense and you really need UUID PKs, but it's not the norm.