mysql - 新手thinkphp商城设计问题
阿神
阿神 2017-05-16 13:03:36
0
1
625

1、商城用户购买商品一旦生成订单就修改商城库存 这时候是直接修改数据库的数据还是先缓存商品的库存值 然后统一全局修改这个缓存值等到某一时间再写入数据库?
2、并发处理如何加锁

阿神
阿神

闭关修行中......

reply all (1)
Peter_Zhu

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. . .

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!