当前位置:网站首页>Redis distributed lock to be continued

Redis distributed lock to be continued

2022-07-24 00:19:00 A little dog

Redis Distributed lock





In order to ensure the final consistency of data , Use Redis Distributed lock
When multiple processes are not in the same system , Using distributed lock to control the access of multiple processes to resources .

Features of locks

First , To ensure that distributed locks are available , We should at least ensure that the implementation of the lock meets the following four conditions at the same time :

1、 Mutual exclusivity : Anytime , Only one client can acquire the lock , You can't have two clients acquire locks at the same time .

2、 Security : The lock can only be deleted by the client holding the lock , Cannot be deleted by other clients .

3、 Deadlock : The client that gets the lock for some reason ( Such as down Machine, etc ) And failed to release the lock , Other clients can no longer acquire the lock .

4、 Fault tolerance : When some nodes (redis Nodes etc. )down operation period , The client can still acquire and release locks .






Please correct me if there is any mistake

原网站

版权声明
本文为[A little dog]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/205/202207240014083675.html