Java-Interview-Advanced/docs/distributed-system/distributed-lock-taobao-and-jingdong.md
2020-04-25 19:55:58 +08:00

7 lines
506 B
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

大公司一般有分布式kv存储tairredismongodb高并发每秒几万几十万都没问题甚至每秒百万
实时库存数据放kv存储里去先查库存再扣减库存你在操作库存的时候直接扣减如果你发现扣减之后是负数的话此时就认为库存超卖了回滚刚才的扣减返回提示给用户。对kv做的库存修改写MQ异步同步落数据库相当于异步双写用分布式kv抗高并发做好一致性方案