java - 请教各位前辈们关于分布式锁的应用场景
PHPz
PHPz 2017-04-17 17:24:44
0
2
449

看了下Zookeeper的应用场景之一就是分布式锁,可是感觉和数据库的行锁表锁不一样啊,网上的例子都是和数据库无关的,完全无法理解到底哪里可以应用上去这些锁额……

PHPz
PHPz

学习是最好的投资!

reply all(2)
左手右手慢动作

More sensitive data such as amount modification can only be operated by one person at the same time. Imagine that two people modify the amount at the same time, one adding the amount and the other subtracting the amount. In order to prevent data inconsistency caused by simultaneous operations, a lock is required. If it is required by the database The only thing is row lock or table lock. If it is in a cluster, multiple clients modify a shared data at the same time, which requires distributed lock

小葫芦

For example, multiple machines can execute a certain task regularly. If the task is restricted to be executed by only one machine at a time and cannot be executed repeatedly, distributed locks can be used to mark it.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!