当前位置:网站首页>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
边栏推荐
- Correct opening method of redis distributed lock
- II. Data type
- Making and using the cutting tool of TTF font library
- 只是巧合?苹果 iOS16 的神秘技术竟然与中国企业 5 年前产品一致!
- Introduction to GNN
- Resnet+attention project complete code learning
- Select drop-down box realizes three-level linkage of provinces and cities in China
- Pytorch two-layer loop to realize the segmentation of large pictures
- MySQL transaction
- Take you hand in hand to develop a service monitoring component
猜你喜欢
Take you hand in hand to develop a service monitoring component
The relationship between the size change of characteristic graph and various parameters before and after DL convolution operation
Course design of compilation principle --- formula calculator (a simple calculator with interface developed based on QT)
Redis highly available slice cluster
How can beginners learn flutter efficiently?
MySQL transaction
Read and understand the rendering mechanism and principle of flutter's three trees
Knowledge representation (KR)
Detailed structure and code of inception V3
About cache exceptions: solutions for cache avalanche, breakdown, and penetration
随机推荐
ZABBIX monitors mongodb templates and configuration operations
The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
想问问,如何选择券商?在线开户是很安全么?
只是巧合?苹果 iOS16 的神秘技术竟然与中国企业 5 年前产品一致!
GPON other manufacturers' configuration process analysis
C alarm design
A new WiFi option for smart home -- the application of simplewifi in wireless smart home
Which domestic cloud management platform manufacturer is good in 2022? Why?
Leetcode-1. Sum of two numbers (Application of hash table)
POJ-2499 Binary Tree
Learn the memory management of JVM 02 - memory allocation of JVM
Matlab imoverlay function (burn binary mask into two-dimensional image)
How to clear floating?
MySQL storage engine
Semantic segmentation experiment: UNET network /msrc2 dataset
GPON technical standard analysis I
Acid transaction theory
Recyclerview paging slide
PIP command reports an error pip is configured with locations that requires tls/ssl problems
ZABBIX monitors mongodb (template and deployment operations)