51

实践基于Redis的分布式锁 - 简书

 6 years ago
source link: https://www.jianshu.com/p/e72baf5e5617?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
本文来自社区这周的讨论话题—— 技术专题讨论第四期:漫谈分布式锁,也总结了我对分布式锁的认知和使用经验。 应用场景 当多个机器(多个进程)会对同一条数据进行修改时,并且要求这个修改是原子性的。这里有两个限定:(1)多个进程之间的竞争,意味着JDK自带的锁失效;(2)原子性修改,意味着数据是有状态的,修改前后有依赖。 实现方式 基于Redis实现,主要基于redis的setnx(set if ...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK