Home / Companies / PlanetScale / Blog / Post Details
Content Deep Dive

The problem with using a UUID primary key in MySQL

Blog post from PlanetScale

Post Details
Company
Date Published
Author
Brian Morrison II
Word Count
1,776
Company Posts That Month
4
Language
English
Hacker News Points
5
Post removed?
No
Summary

Universally Unique Identifiers (UUIDs) are designed for generating unique IDs across systems without knowledge of other systems, making them useful in distributed architectures. However, using UUIDs as primary keys in MySQL can hurt database performance due to insertion overhead and increased storage utilization. To mitigate these issues, consider using the binary data type for storing UUIDs, choosing an ordered UUID variant, utilizing built-in MySQL functions like `uuid_to_bin`, or exploring alternate ID types such as Snowflake IDs, ULIDs, or NanoIDs.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.