3 ms·
Finally! I have a question I've been dying to ask for some time. Most of the time, when I hear people talking about UUIDs being better than big ints, it comes
by tomasreimers 4y ago
Finally! I have a question I've been dying to ask for some time.
Most of the time, when I hear people talking about UUIDs being better than big ints, it comes down to big ints leaking data (how many users / posts / comments your site has) and letting an attacker fetch sequential entries (user id 4 works, now try 5). This is even the reasoning in the supabase article. While ULIDs don't reveal the next entry, they do leak data (either creation date or number of entries, as all ULIDs are either prefixed with physical time or logical time).
Why don't we just encrypt / decrypt IDs when going over the wire (most API frameworks even have native methods to transform different types of data)? It suffers from neither issue above, is natively supported by API frameworks, and any time used on compute will be dwarfed by network latency. Is this already a pattern and I just don't know about it?
EDIT: ahh, below they list one advantage of UUIDs / ULIDs which is you can generate client side. That is reasonable.