更新项目时,Azure Redis缓存中是否有任何锁定机制? [英] Is there any lock mechanism in Azure Redis Cache while updating an item?

查看:101
本文介绍了更新项目时,Azure Redis缓存中是否有任何锁定机制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure搜索来处理Azure Redis缓存,但是找不到有关Redis Cache并发性的任何清晰描述.

I'm working on Azure Redis Cache with Azure Search but I couldn't find any clear description about concurrency of Redis Cache.

是这种情况.覆盖现有的缓存项时,是否可以在相同的准确时间读取该项?如果是,Redis Cache如何管理它?它会在商品可用之前锁定商品,还是会给出商品的旧版本?

Here is the case. While overwriting an existing cache item, is it possible to read the item at the same exact time? If yes how does Redis Cache manage this ? Does it lock the item until it gets available or does it give an old version of the item ?

通过我使用StackExchange.Redis客户端的方式.

By the way I'm using StackExchange.Redis client.

推荐答案

Redis是单线程的,因此所有操作都是原子的.如果有更新/删除,在操作完成之前,没有其他人可以读取该密钥.此处有更多详细信息-单线程性质-redis

Redis is single threaded so all operations are atomic. If there is an update/delete there is nobody else that can read that key until the operation finishes. More details here - single-threaded-nature-of-redis

这篇关于更新项目时,Azure Redis缓存中是否有任何锁定机制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆