What can the watch command in redis transaction do?

Alibaba cloud Q & A 2022-02-13 08:31:25 阅读数:968

watch command redis transaction

Redis In the transaction WATCH What can commands do ?




Take the answer 1:

WATCH Command is an optimistic lock , It can be for Redis Services provide check-and-set (CAS) Behavior . Can monitor one or more keys , Once one of the keys is modified ( Or delete ), After that, the transaction will not be executed , Monitoring continues until EXEC command .


copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130831235005.html