# Overview Cache-aside caching is... #flashcard known as lazy loading, this is the most common caching strategy. When data is requested, the application first checks the cache. If the data is present, it is considered a "cache hit" and the data is returned. If it is not present (a "cache miss", the database is queried by the application. The result is stored in the cache for future use and returned to the requester. <!--ID: 1751507776592--> ## Diagram ![[Cache-aside 2024-12-19 09.52.47.excalidraw.svg]] %%[[Cache-aside 2024-12-19 09.52.47.excalidraw|đŸ–‹ Edit in Excalidraw]]%% # Key Considerations # Pros The pros of cache-aside cache are: #flashcard - The cache only contains data used in the application, thus making it cost-effective - Straight-forward implementation <!--ID: 1751507776595--> # Cons The cons of cache-aside cache are: #flashcard - There is a performance hit on the initial access of the data - Requires an emphasis on cache invalidation. If there is a hit on old data in the cache, the application won't know there is newer data in the database <!--ID: 1751507776598--> # Use Cases The use cases of cache-aside cache are: #flashcard - Read heavy workloads <!--ID: 1751507776600--> # Related Topics