Consistency of the database and cache data

Delete the cache or update the cache?

Look at the situation, most of the time you can delete the cache directly, after all, if the update cache needs a lot of computing resources and databases, it will be delayed update to the query is a good choice.
However, if there is an actual scene, nor is it can not update the cache. Or, delete immediately after insertion, all to see the scene now.

Guess you like

Origin www.cnblogs.com/zhouj-happy/p/10990772.html