P
P
prizrak392017-05-06 16:24:30
Java
prizrak39, 2017-05-06 16:24:30

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

3 answer(s)
A
Alexander Kosarev, 2017-05-10
@jaxtr

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.

D
D3lphi, 2017-05-06
@D3lphi

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.

P
prizrak39, 2017-05-06
@prizrak39

Then I will describe the essence of the problem in a little more detail. I have some information about the user and I need to supplement it, that is, not completely reload it, but to supplement it. So I thought that I can use the cache for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question