34

分布式锁总结

 5 years ago
source link: https://juejin.im/post/5bfdef3051882558da6fdf23
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.
基于数据库: 基于数据库表做乐观锁,用于分布式锁。(version) 基于数据库表做悲观锁(InnoDB,for update) 基于数据库表数据记录做唯一约束(表中记录方法名称) 复制代码 基于缓存: 使用redis的setnx()用于分布式锁。(se

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK