redis - 如何对列表进行合理的缓存
大家讲道理
大家讲道理 2017-04-24 09:11:37
0
2
990

在使用redis做缓存的时候,缓存单个的数据是比较容易的,那么如何话缓存列表比较合适呢?因为列表可能涉及更新和删除,还有分页。

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
迷茫

Redis itself is an in-memory database, and the data will be loaded into the memory, and the data will be updated to the disk according to the customized persistence strategy.
So you don’t have to worry about disk IO caused by a large number of DML operations

伊谢尔伦

It depends on the specific business.
You can cache only the ID of a single piece of data in the list, and then you don’t need to worry about the update.
When deleting a single piece of data, there must be a mechanism to delete the piece of data in the list cache, and the deletion operation should be infrequent. If so, you can delete them all.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!