As part of a new project we need a service which can generate monotonically increasing integers. Requirements for the service are:
- service does not need to produce contiguous integer as long as it produces monotonically increasing integers it should be fine
- It should produce 64 bit integer
- the service should be highly available
- services should be resilient to failure (or restarts)
I was planing to use redis (INCR
) as a back-end store with replication enable but the issue is if the master redis fails then it may be possible that the service may loose some integers (think that before even the update flows down to slave, master crashes then the service may loose some integers i.e. service can generate a number which is less than already generated value).
Can someone help me in design such a system/service.