当前位置:网站首页>Distributed solution - distributed lock solution - redis based distributed lock implementation
Distributed solution - distributed lock solution - redis based distributed lock implementation
2022-07-05 12:32:00 【vx-Yang_ Gaige】
Distributed lock solutions
Distributed lock can be implemented in three ways :
- Database optimistic lock ;
- be based on Redis Distributed locks for ;
- be based on ZooKeeper Distributed locks for
Database optimistic lock ;
be based on Redis Distributed locks for ;
be based on ZooKeeper Distributed locks for
be based on zookeeper Distributed lock implemented by instantaneous ordered nodes , Its main logic is as follows ( The figure comes from IBM Website ). The general idea is : When each client locks a function , stay zookeeper Under the directory of the specified node corresponding to the function , Generate a unique instantaneous ordered node . The way to determine whether to acquire a lock is simple , Only one of the ordered nodes with the smallest sequence number needs to be judged . When the lock is released , Just delete the instantaneous node . meanwhile , It can avoid the lock cannot be released due to service downtime , And the deadlock problem .
High lock security ,zk Be persistent
边栏推荐
- 信息服务器怎么恢复,服务器数据恢复怎么弄[通俗易懂]
- Swift - add navigation bar
- Pytorch two-layer loop to realize the segmentation of large pictures
- Pytoch uses torchnet Classerrormeter in meter
- 7月华清学习-1
- The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
- Error modulenotfounderror: no module named 'cv2 aruco‘
- Get all stock data of big a
- ZABBIX agent2 installation
- ZABBIX customized monitoring disk IO performance
猜你喜欢
Tabbar configuration at the bottom of wechat applet
Learn the memory management of JVM 02 - memory allocation of JVM
Resnet18 actual battle Baoke dream spirit
Solve the problem of cache and database double write data consistency
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
Embedded software architecture design - message interaction
[superhard core] is the core technology of redis
Reinforcement learning - learning notes 3 | strategic learning
MySQL splits strings for conditional queries
Seven ways to achieve vertical centering
随机推荐
ZABBIX 5.0 - LNMP environment compilation and installation
GNN(pytorch-geometric)
MySQL splits strings for conditional queries
About cache exceptions: solutions for cache avalanche, breakdown, and penetration
Principle and performance analysis of lepton lossless compression
Get all stock data of big a
Learn JVM garbage collection 05 - root node enumeration, security points, and security zones (hotspot)
Which domestic cloud management platform manufacturer is good in 2022? Why?
Swift - add navigation bar
Redis clean cache
POJ-2499 Binary Tree
Pytoch loads the initialization V3 pre training model and reports an error
Matlab struct function (structure array)
Seven polymorphisms
Constructing expression binary tree with prefix expression
手机 CPU 架构类型了解
POJ-2499 Binary Tree
Average lookup length when hash table lookup fails
Solve the problem of cache and database double write data consistency
GPS数据格式转换[通俗易懂]