I have a problem very similar in nature to Java: Unique 10 digit ID where I need to generate a subset of a 10 digit sequence in the event that there is a DB outage and I can't use its sequence generator.
I'd like to use this feature, but my use case requires that I keep track of the last ID generated so as to not cause collisions. This needs to be done in a fault tolerant way - and the value should survive a failover from one DC so if the Hazelcast cluster comes up we start back at the last used value.
My thoughts when looking through the Hazelcast docs were to configure write-behind persistence and set the delay to be close to the DB-SLA for an unplanned outage (on the order of a few hours however I have a feeling this might not be advisable). And then try to retrieve the latest ID used if the cluster starts and the value is 0 -- meaning the entire cluster was restarted.
Any thoughts?
EDIT Sounds like this answer could be onto something - using a shared filesystem and serializing to a flat file. What if I can't get a shared filesystem provisioned in my environment. Are there any other options?