Skip to content
0:00 / 0:00

#uuid#cuid2#mysql

The Problem With UUIDs

Theo - t3․gg

576K subscribers • 14 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Theo Browne
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

221K views2 years ago1 recommendation

Databases and dataSoftware designDatabase internalsSQL

Theo Browne explains why using UUIDs as primary keys can cause performance issues in databases like MySQL and discusses alternatives.

THANK YOU PLANETSCALE FOR SPONSORING THIS VIDEO UUID's have a time and place, but I rarely see them used correctly. I've wanted to do this rant for awhile and I'm happy I did because CUID2 is NOT a good option either 🙃 SOURCE planetscale.com/blog/the-problem-with-using-a-uuid-primary-k… Check out my Twitch, Twitter, Discord more at t3.gg S/O Ph4se0n3 for the awesome edit 🙏

Why it's here

1 person recommends this

What people say. Recommended for its explanation of database index fragmentation caused by random UUID primary keys.

u/Rcomianin r/node • Recommends

On “ID vs UUID vs Both in SQL DB?”

…is usually around 100 years. another alternative would be to use a uuid as your primary key, but cluster by another field such as a creation timestamp that doesn't change. this way only your index gets fragmented, which is smaller and so a smaller issue than the main data, which might be a valid compromise in low volume, large record situations. link to this video…