logoalt Hacker News

bambaxtoday at 7:49 AM2 repliesview on HN

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.


Replies

elcomettoday at 10:09 AM

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

victorbjorklundtoday at 2:46 PM

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