Reputation: 19385
I have a number of servers running and need to generate sequential numbers across them which will be represented in a 5-character alpha-numeric string. Currently this is being slightly fudged by Base32-encoding the number of seconds since midnight as this is unique enough for testing purposes. Preferably we'd be using UUIDs/GUIDs but the 5chr limit is out of our control.
What other approaches could I use to get something "unique" across a number of servers (say, 20 maximum) that's also somewhat sequential?
Upvotes: 0
Views: 69
Reputation: 19611
Have a master server allocate batches of numbers to the other 19 client servers. Each client uses up the numbers in its batch one by one and then asks the master server for another batch.
Upvotes: 1