Maintaining nonephemeral data
Nonephemeral type of data is not dependent on time and has usefulness throughout its existence in the system. Since this kind of data is time-independent, it is possible that the data can increase in due course of time. This can be problematic in Redis since data is stored in memory in Redis. Handling and maintaining this nonephemeral data is crucial for the maintenance of Redis since at the back of our minds, we have to keep the available memory and availability of data in mind.
Redis comes with some capabilities to handle the previously discussed scenarios, which is if the datastore grows at an alarming rate, as it can outgrow the memory available. In such scenarios, adding more RAM can solve the issue, or we can distribute the datasets using a programmatic technique called Sharding. However, in this chapter, we will discuss a mechanism to maintain data that is not required in an active application but needs to be stored.
Let's see a few in-built techniques...