It´s just about caching, honey!

Sometimes we want to read data once from a store and cache it in memory because retrieving it from the source is rather expensive. There are two strategies to achieve that:

The first way of caching is achieved by loading the entire data of a given type from some source at once and access it from the cache. This is suitable for small caches or if most cache entries are likely to be read.

An alternative is a growing cache. Whenever data is requested from the cache the first time the cache will load it from the given source, cache it and finally, return it to the client. If data is requested from the second time on it will be returned from the cache without accessing the source.

Continue reading “It´s just about caching, honey!”