2 ms·
Internally you can work completely with sequential int64 IDs, and at the API edge you have to spend ~30 clock cycles (about the cost of an L3 cache hit) on each
by wongarsu 4y ago
Internally you can work completely with sequential int64 IDs, and at the API edge you have to spend ~30 clock cycles (about the cost of an L3 cache hit) on each id to encrypt/decrypt it. For any workload that can benefit from better data locality from sequential IDs this could well be a performance win over UUIDs, especially at scale.
Of course ULIDs offer something very similar. But they leak more information, which makes them less desirable for some use cases.
- preseinger 4y agoThe benefit here, I guess, that you get the advantages of sequential IDs internally? I can't see how this could possibly outweigh the costs of user-visible IDs being different than internal IDs, and transformable only thru a {de,en}cryption process -- requiring all the standard maintenance, key rotation, etc.