jeudi 28 février 2019

How does a system with an LRU cache in a layer before actually accessing the database maintain the most updated information?

Assume you have a system that primarily reads large amounts of data, like pinpoint locations in coordinate form. You can set up an LRU cache in some layer before he actual database to prevent the database from being accessed constantly and redundantly.

However, in typical implementations of such a cache, what are the mechanisms in place to the deal with, for example, if data infrequently but definitely will be modified and/or deleted? Say this happens at a rate of 1/100 or 1/1000 where such a cache is very efficient. Are there any common solutions to this? Does the application communicate with the cache to check and see if such an item would be dropped? Many caches I see do not seem to have any mechanism in place. Is there some kind of reoccurring cache validation that the server runs?

Aucun commentaire:

Enregistrer un commentaire