4 ms·
If you need the time, couldn't you just add a timestamp? Sometimes ordering by ID makes sense, but I don't understand why it would be seen as necessary.
by DanielStraight 14y ago
If you need the time, couldn't you just add a timestamp?
Sometimes ordering by ID makes sense, but I don't understand why it would be seen as necessary.
- jondot 14y agoSure, you could. The post refers to the case of just time+randomness. This case is unfortunately not sufficient when you apply the additional constraints mentioned (such as number of bits). It's not necessary, but if you try to store data in things like Cassandra (or even Redis), it becomes crucial for your data model querying strategies.
- Retric 14y ago48 bit's is plenty to use time stamp truncated to whatever accuracy you need + either random assignment or giving each machines it's own range to assign numbers. Until you need more than 100,000 ID's per second when you just need more bits.