All Questions
Data Modeling medium

Why would you choose a UUID (GUID) as a Primary Key over an Auto-Increment Integer?

  1. A It allows clients to generate unique identifiers while offline and prevents the leaking of sensitive business metrics through sequential IDs.
  2. B UUIDs offer significantly faster b-tree traversal and index lookups due to their inherently compact, non-fragmented binary representation.
  3. C UUIDs consume less overall storage space on the disk as they are natively optimized by the database's internal prefix-compression algorithms.
  4. D UUIDs are strictly required by all modern REST and GraphQL APIs to ensure high availability and prevent cross-origin resource sharing errors.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions