Answer the question
In order to leave comments, you need to log in
How to properly organize the application cache?
Hello.
There is a task of implementing a cache for a simple social network - a backend for a mobile application.
I want to use memcached as a caching tool.
Am I right in thinking that a separate application is needed that will constantly track changes in the main database and keep the cache up to date?
Or is it superfluous and work with the cache needs to be implemented only at the API level?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Having a separate application to keep track of the freshness of the cache is an additional (unnecessary) headache.
It would be better to implement the correct use of the cache:
In Java EE and Spring, this is all set up with annotations.
If you constantly monitor data changes and update the cache, then what's the point in it? The whole point of the cache is to get rid of sufficiently long, frequent database queries in order to increase the speed of your application. The fact that the data in the cache will not be the most relevant is the norm. It is important to understand that you need to cache the data that changes relatively infrequently, otherwise, the advantage of using it will be small.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question