MySQL inside has 2000w of data and redis only stores 20w of data. How to ensure that the data in redis are hot data?

  mysql, question

MySQL inside has 2000w of data and redis only stores 20w of data. How to ensure that the data in redis are hot data?

In order to@ybakOn the basis of the answer, I said a relatively simple and practical solution.

Limit the memory occupied by Redis. Redis will load hot data into memory according to its own data retirement strategy.
Therefore, calculate the memory occupied by 20W data and then set the Redis memory limit.