hazelcast distributed id generation

1.7k Views Asked by At

Hazelcast has inbuilt distributed id generator as mentioned here http://docs.hazelcast.org/docs/latest/manual/html/idgenerator.html. The challenge is whenever cache server restart the sequence is lost and restart from zero. As a solution they try to provide an init function which can start id from a specific int. What is the best way to use it to have a continuous id generation no collision which will persist even after server restart and give best performance.

1

There are 1 best solutions below

2
On BEST ANSWER

Yes you can persist the ID and set it to the last value after node restarts. Depending on your needs of a continuous ID you might want to look into another external (my) project https://github.com/noctarius/snowcast which works differently.