I used to use PostgreSQL sequence SELECT nextval('number');
to make sure I get a new number even if there are several clients since nextval
is guaranteed to return distinct and increasing values.
I wanted to use the same mechanism with Redis.
I thought using the INCR
command but I want to make sure I well understand that it will give the same guarantee than the nextval
command?
There is no risk of getting the same number when several processes run this command or do I have to use a Redis lock?
Thanks