3 ms·
I like the ULID properties for the database, but it misses so many of the human factors that would make it excel. Your tokens/identifiers should look like this
by echelon 3y ago
I like the ULID properties for the database, but it misses so many of the human factors that would make it excel.
Your tokens/identifiers should look like this:
namespace_crockfordEncodedEntropy
- There must be token/identifier prefixes like Stripe. While one could concatenate/prefix these bytes in application code, it's best to just accept the overhead and store them in your records for ease of lookup. It makes an engineer's life so much easier when debugging foreign keys on the fly or during an emergency SEV.
- There should be no hyphens (in string serialization). You probably want to encode and store crockford directly rather than do bytes to hex encoding, again for engineer ease of use.
- You may want to leave some trailing bytes for request routing in active-active high SLA systems. Especially for when record lookup cannot fail.
- FridgeSeal 3y agoI’ve seen this sort of design referred to as “typed IDs”: https://github.com/jetify-com/typeid https://github.com/jetify-com/typeid Doesn’t use the crockford encoding, but does is another one that minimises confusables. Definitely looks pretty solid, so keen to give them a shot in my next project.