H
H
Hfnas2019-10-12 00:14:03
caching
Hfnas, 2019-10-12 00:14:03

When should data caching be used?

When should data caching be used?
For example, with requests from the database, and if infa from the database is updated 5 times during the life of the cache, then the cache will not be erased?
Of course, we can set the lifetime of the cache? And if infa from the database will be constantly updated?
Specify, please, a hundred cases in which caching should be applied.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daria Motorina, 2019-10-12
@glaphire

The cache should be used to reduce the load on the database (query frequency, computational complexity) and increase the speed of returning results with this data.
The lifetime of the cache must be selected according to the situation. There should always be a trigger that invalidates the old cache and caches the new data so as not to store the wrong ones. For very frequent data updates, the cache may be pointless.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question