Redis data elimination strategy
Redis provides 6 data elimination strategies:
● volatile-ru: select the least recently used data elimination from datasets with an expiration time set
Volatile-lfu: delete the one that is least used for a period of time from the Keys that has been set to expire
● voltil-tt: selects recently expired data from datasets that have been set to expire
● volatile-random: randomly select data elimination from a dataset with an expiration time set
Allkeys-ru: select the least used data from the dataset to be eliminated
● llkeys-Ifu: removes the one that is least used for a period of time from all Keys
● alkeys-random: randomly selecting data from a dataset for elimination
● no-enviction (expulsion): expulsion data is prohibited (no phase-out strategy is used. The default is configured for this), for write
Operation, return error message
Suggestion: after understanding the elimination strategy of Redis, you should take the initiative to set / update the expire time of key when you use it.
Active elimination of inactive old data helps to improve query performance