Home > database >  Questions about Redis expire if the key is deleted
Questions about Redis expire if the key is deleted

Time:10-08

Redis person, there is a question,
Redis expiration time, can be set to key will be automatically deleted after expired?
If will be automatically deleted, lazy to delete and periodically delete mechanism significance?
Don't understand, please tell the great spirit

CodePudding user response:

The great spirit guide, please

CodePudding user response:

Redis for expired keys have three clear strategy:
Passive delete: when a read/write a key has expired, will trigger the inert deletion policy, direct delete the overdue key
Active removal: as the inert deletion policy there is no guarantee that cold data is deleted in time, so the Redis regularly active phased out a batch of expired key
Is currently in memory more than maxmemory limit, trigger clear strategy actively
  • Related