3 ms·
There is also a pattern referred to as "high/low keys"[0] and works quite well so long as the architecture guarantees access to the master when a new high key i
by AdieuToLogic 9y ago
There is also a pattern referred to as "high/low keys"[0] and works quite well so long as the architecture guarantees access to the master when a new high key is needed.
Of course, this can be mitigated by allocating small batches of high keys as well if connectivity to the master is unreliable. However, having a 32 bit low range implies the need for batch high key allocation is negligible for all but the most pathological situations.
0 - https://stackoverflow.com/questions/282099/whats-the-hi-lo-algorithm/282113#282113 https://stackoverflow.com/questions/282099/whats-the-hi-lo-a...
EDIT: Re-read your original description and realized you described a related, but different, approach of directly reserving key ranges.
- manigandham 9y agoYes, we reserve the actual number range which is simpler and avoids errors. I havent come across a standard name for this scheme though. We reserve millions of numbers at a time and it works perfectly, and the batch can easily be adjusted to account for usage factor and potential downtime buffering.