Java-Interview-Advanced/docs/distributed-system/distributed-lock-taobao-and...

7 lines
506 B
Markdown
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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