Introducing Redis
Redis is often classified as a key-value data store. Redis describes itself as a data-structure store. It offers storage types similar to the basic data structures found in most programming languages.
Why use Redis?
Redis operates entirely in memory, allowing it to be very fast. This, together with its key-value nature, makes it well-suited for use as a cache. It also supports publish/subscribe channels, which allows it to function as a message broker. We'll look at this further in Chapter 10, Real-time Web Apps in Node.js.
More generally, Redis can be a useful backend to allow multiple Node.js processes to co-ordinate with one another. Node.js scales horizontally and most websites will run multiple Node.js processes. Many websites have "working" data that doesn't need to be persisted long term, but does need to be available quickly and consistently across all processes. Redis's in-memory nature and range of atomic operations make it very useful for this purpose.
Redis is built...