I researched a lot of URL shorteners for Rails in the web, and a majority of them delegate the persistence feature to redis.
Can anyone explain to me the benefits of using a key-value store, like Redis, instead of the database for persisting and accessing short URLs?
Databases like redis are optimized for storing lots of small values (such as links and their short urls) because they are loaded up into memory (ram). This means when a call is made to redis it reads data from ram (faster) instead of the hard drive (slower).
EDIT:
If you would like to learn more, this is a great writeup of the advantages and shortcomings of the top no-sql databases. Definitely a great reference.