logoalt Hacker News

sedatk • yesterday at 5:40 PM • 4 replies • view on HN

You probably don't need a UUID: https://ssg.dev/you-probably-dont-need-a-uuid/


Replies

kune • yesterday at 6:06 PM

I support this. I wrote a Sqlite plugin for KSUIDs, but at the end I never used them, since all I do can be handled by integer primary keys, which sqlite maps to the rowid automatically. Autoincrement is only required, if you want to prevent the reuse of ids in deleted rows.

mahboi • yesterday at 6:25 PM

For a database primary key, yeah. Just use serial.

➕ show 2 replies
nodamage • yesterday at 6:30 PM

...if you work specifically on web applications with a centralized database.

Some of us don't, so these types of universal proclamations are rather unhelpful.

woogle • yesterday at 6:54 PM

another benefit of not using UUID:

for AI heavy apps/agent they are token expensive