Databases · Junior · Question 9 of 75
What is a common reason to use UUIDs instead of incrementing integers as IDs?
- ✓Correct answer: IDs can be generated anywhere (client, several servers) without coordination and don't reveal how many rows exist
- 2UUIDs take less space than integers
- 3UUIDs make queries faster in every case
Explanation
UUIDs are 16 bytes vs 8 for bigint. Random UUIDs (v4) also spread inserts across the index; time-ordered UUIDs (v7) avoid that.