Redis: Using one mset operation with bunch of expire operations in pipeline or bunch of set operation with expiration in pipeline

两盒软妹~` 提交于 2021-02-11 15:19:22

问题


In terms of performace which is better?, A: set 500 keys with mset and then 500 expires in a pipeline B: 500 set with expiration in a pipeline too.

Thank you!


回答1:


MSET is a atomic operation, use them when you want atomicity for those keys, else use SETEX in pipeline. For performance you have to test them.



来源:https://stackoverflow.com/questions/61626398/redis-using-one-mset-operation-with-bunch-of-expire-operations-in-pipeline-or-b

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!