Skip to content

Comment on The perils of UUID primary keys in SQLite

Comments

Why would you use UUIDs a primary keys? Let SQLite use rowids internally (which is automatic and invisible), and have a different (indexed) column with UUID if you need that for publishing the ID somewhere.

UUID as key is useful when you have a distributed system where multiple workers create items independently

Because another app can then create the id and add it to the db later.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.