I need an implementation of an Atomic Counter on cloud to produce a serial integer from concurrent connections. The business behind is a tracking server.
CREATE SEQUENCE serial CACHE 100; SELECT nextval(sequence)
I think you are overestimating the risk of a redis failure that leaves it unable to flush to disk and underestimating the risk of any RDBMS doing the same. The risk can be mitigated in both by syncing writes to disk.
In redis this means switching to AOF (Append Only File) mode, as described in the persistence link you already link to.
There is no need to do any expiring key trickery. The atomic behavior of
incrby are more than sufficient to ensure uniqueness and durability, especially when combined with AOF persistence.
Redis is just about perfect for this use case. It is fast enough and scaleable. Redis has been around a while now. There are no legitimate durability concerns that wouldn't also be concerns for PostgreSQL or MySQL.