Hacker News new | ask | show | jobs
by ei8ths 1291 days ago
I'll stick with unsigned integers on the server side and I use uuid's for when it's facing a client, example a link, /page/view/<uuid> just makes sense.
1 comments

Seems like you are choosing the worst of both cases then. If you are effectively using uuid as a slug there are better choices out there that take less space to encode store and index.
I need to keep it unique, don't uuid's stay unique? I'm all ears to changing it for a smaller size.
https://github.com/Jakeii/nanoid-postgres is an example of one way just pick a length that has enough space for your projected maxcount and ensure unique on the schema/index.