Cache Aside
Cache-aside caches are usually general purpose and work best for read-heavy workloads. Memcached and Redis are widely used.
Read Process
- The application first checks the cache.
- If the data is found in cache, we’ve cache hit. The data is read and returned to the client.
- If the data is not found in cache, we’ve cache miss. The application has to do some extra work. It queries the database to read the data, returns it to the client and stores the data in cache so the subsequent reads for the same data results in a cache hit.