As an in-memory data store, Redis uses more memory space than databases that always persist data to disk. Although nowadays the cost of memory is lower, it is still necessary to budget the memory space for Redis in the production environment. In addition, as Redis is often used as a cache, besides setting timeout values to make keys expire automatically, we also need to consider the conviction policy when the cache is full. In this recipe, we will introduce two important memory configuration options in Redis with examples.
You need to finish the installation of the Redis Server, as we described in the Downloading and installing Redis recipe in Chapter 1, Getting Started with Redis.