Home > database >  Cache data update problem solving
Cache data update problem solving

Time:09-21

In the case of high concurrency, if when delete the cache to update the database at this moment, but I haven't updated, another request to query the data and found not in the cache, go to check in the database, inventory, for example, if the inventory of the database products is 100, the query to the inventory is 100, and then inserted into the cache, after inserting the cache, updates the database on the same thread to update the database for 99, lead to inconsistent database and cache, appear this kind of circumstance solution

CodePudding user response:

Update lock, everyone wait in line
  • Related