UUID as Primary Key

Difficulty: Intermediate

Question

What are the drawbacks of using UUIDs as primary keys?

Answer

They take 16 bytes (vs 4/8 for INT), they are random (which hurts insert performance in clustered indexes), and they are harder to read/debug.

Concepts covered

Distributed IDs, Performance