11 ms·
I’ve always liked instagrams id_generator() for sortable bigints without an external point of failure. http://www.livinginthepast.org/2016/02/24/sharding-into-
by pcmaffey 6y ago
I’ve always liked instagrams id_generator() for sortable bigints without an external point of failure.
http://www.livinginthepast.org/2016/02/24/sharding-into-bigints.html http://www.livinginthepast.org/2016/02/24/sharding-into-bigi...
- jarym 6y agome too - and I Base64 encode it to make it human readable
- pcmaffey 6y agonot sure I understand the base 64 encoding: a bigint generated with this: 2457081803026990508 base64 encoded: MjQ1NzA4MTgwMzAyNjk5MDUwOA== why?
- fatsdomino001 6y agoSounds like they mean they're just hashid'ing the bigint id, likely stored in a separate slug column with the output
- jarym 6y agothe bigint is just 64 bits so I b64 encode the binary representation which is about half the size.