Show HN: Decentralized, k-ordered unique IDs in Clojure
github.com
github.com
One thing I had to look up again was the definition of k-ordering: K-ordering gives roughly time-ordered id's down to the millisecond when sorted lexicographically. This is usually fine for most purposes but keep in mind it doesn't allow you to reason about causality between timestamps from different machines.
This also relies on your servers clocks to be in sync (something that should be happening anyway).
* No single point of failure if the id server goes down * Avoiding network round trip latency * You have distributed servers across multiple data centres (though clock sync may be an issue)
If your service can tolerate k-ordered ids then I would pick this over a central server every time.
These Flakes relax those restrictions and are 128 bits. The benefit is that they don't require a central server to distribute worker ID's and the epoch is the standard Unix epoch. This holds as long as the MAC addresses on your machines are unique. As another commenter mentioned, this doesn't always happen.
Technically thats per MAC not per machine. I've run into multiple NICs with duplicate MACs as has everyone else who's been in the game long enough.