mysql - Newbie thinkphp mall design issues
阿神
阿神 2017-05-16 13:03:36
0
1
757

1. Once a mall user purchases a product and generates an order, they modify the mall inventory. At this time, should they directly modify the database data or cache the inventory value of the product first and then modify the cached value globally and wait until a certain time? Write to database?
2. How to lock for concurrent processing

阿神
阿神

闭关修行中......

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