Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The biggest reason is that your IDs become universally unique - across shards, across database recoveries, rollbacks and session problems, you name it. These are all the kinds of things that can happen over the lifespan of a dataset.

In Postgres, UUIDs are stored in 128 bits, so it's hardly any overhead in almost all use cases, so if you can save yourself a day or two, or three, or a week of work just by switching your mental default from an integer to a UUID, that's a pretty big win.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: