mirror of
https://gitee.com/shishan100/Java-Interview-Advanced
synced 2025-08-05 15:12:26 +00:00
first commit
This commit is contained in:
6
docs/distributed-system/distributed-lock-taobao-and-jingdong.md
Executable file
6
docs/distributed-system/distributed-lock-taobao-and-jingdong.md
Executable file
@@ -0,0 +1,6 @@
|
||||
|
||||
大公司一般有分布式kv存储,tair,redis,mongodb,高并发,每秒几万几十万都没问题,甚至每秒百万
|
||||
|
||||
实时库存数据放kv存储里去,先查库存再扣减库存,你在操作库存的时候,直接扣减,如果你发现扣减之后是负数的话,此时就认为库存超卖了,回滚刚才的扣减,返回提示给用户。对kv做的库存修改写MQ,异步同步落数据库,相当于异步双写,用分布式kv抗高并发,做好一致性方案
|
||||
|
||||
|
Reference in New Issue
Block a user