Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

How can i generate consecutive codes with redis?

$
0
0

i would like to generate a consecutive codes, like PR00001, EC00002, TG00003 and so on, the first two letters have to be from the name and the last name.

my pseudocode is

recovery the number from database 00001, add +1 then i will get 00002 and concat with the lettersPR+00002 

but my team lead suggested to use redis to generate that code, to me is simple why should i use redis to generate that code?

how should i implement that code using redis?


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>