1、商城用户购买商品一旦生成订单就修改商城库存 这时候是直接修改数据库的数据还是先缓存商品的库存值 然后统一全局修改这个缓存值等到某一时间再写入数据库?
2、并发处理如何加锁
天蓬老师2017-05-16 13:05:36
When the amount of access is large, it is not good to perform frequent read and write operations on the database. It is recommended to use the cache layer and use the queue to update in batches at the same time.
As for the locking issue (I don’t have any substantive suggestions), I generally adopt pessimistic locking. . .