Skip to content

Comment on Ask HN: How should I create a unique id for entries that aren't incremental?parent

Comments

That's still incremental though. It just looks different.

bigint gives you 9.2 quintillion options before you run into a collision. Which is obviously not forever proofed, but certainly future proofed.

OP isn't asking for a data type that can hold more than a billion records.

OP needs a way to generate a random ID without checking that the ID has already been used -- s/he wants a UUID. Bigint is FAR too small to do that a billion times without a collision.

AboutSource Built by g1lg1l

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