The Cache-Aside pattern
In situations where data is more frequently read than updated, applications use a cache to optimize repeated access to information stored in a database or data store. In some systems, that type of caching mechanism is built in and works automatically. When this is not the case, we must implement it in the application ourselves, using a caching strategy that is suitable for the particular use case.
One such strategy is called Cache-Aside, where, to improve performance, we store frequently accessed data in a cache, reducing the need to fetch data from the data store repeatedly.
Real-world examples
We can cite the following examples in the software realm:
- Memcached is commonly used as a cache server. It is a popular in-memory key-value store for small chunks of data from the results of database calls, API calls, or HTML page content.
- Redis is another server solution that is used for cache. Nowadays, it is my go-to server for caching or application...