Key expiration
A simple and robust method to keep your Redis database from exceeding it's available memory is to set timeouts on keys that will be automatically evicted after the key's timeout expires. If your application does not need to retain stale or old data, having an effective expiration strategy for your key-space will keep the memory demands for your Redis application more manageable. A popular Redis design pattern using key expiration is to save expired or evicted data into another relational SQL database or other more disk-based NoSQL platform like MongoDB.
There are some aspects of key expiration that you should be aware of when implementing this feature in your application. First, when you call a timeout with the EXPIRE command on ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access