DEV Community


Discussion on: From monolith to cloud: Auto Increment to UUID

bgadrian profile image
Adrian B.G. Author

Wow nice, my brain just got bigger.

Also I found this on the ksuid repo which is a good extra for my article.

KSUID look nice, and knowing what does I see their need for such a thing.

KSUIDs are 20-bytes: a 32-bit unsigned integer UTC timestamp and a 128-bit randomly generated payload. The timestamp uses big-endian encoding, to allow lexicographic sorting. The timestamp epoch is adjusted to March 5th, 2014, providing over 100 years of useful life starting at UNIX epoch + 14e8. The payload uses a cryptographically-strong pseudorandom number generator.

It is like a json web token with a timestamp and crypto-randomness, sounds like a cookie treat.