Snoflake: All content tagged as Snoflake in NoSQL databases and polyglot persistence
Thursday, 23 February 2012
Generating Numerical Sequences With Redis
Thomas James:
The GUID/UUID data type is great for replacing the numerical ID of a record with something that can stand up to the challenges of distributed data, but they are not very suitable for use by the end-user. In some applications you really do still want to be able to generate a reliable numerical sequence number, such as for an invoice number. […] It may seem like overkill to add an additional component to our software stack just to handle the task of keeping a counter, but Redis fits the mould perfectly in this case. Its also simple to setup and use, not adding much to the solution’s overhead. Especially considering that, like CouchDB, the redis instance is “in the cloud”.
I do feel this is overkill and one could generate the sequence at the application level. And even if there is a proposed feature for adding a 128-Bit K-ordered unique id generator to Redis, for high scale decentralized ID generation one should look into Twitter’s Snowflake or Boundary’s Flake.
Original title and link: Generating Numerical Sequences With Redis (©myNoSQL)
via: http://www.thomasvjames.com/2012/02/relax-unwind-with-a-little-redis/