Last Updated: February 3, 2026
You have decided to add caching to your application. The obvious question is: who manages the cache? Does your application explicitly control what goes in and out? Does the cache automatically sync with your database? Does the database itself handle caching?
The cache-aside pattern, also known as lazy loading, is the most common answer: your application code explicitly manages the cache. When reading data, the application checks the cache first. On a miss, it fetches from the database and populates the cache. On writes, the application updates the database and invalidates the cache.
This pattern gives you complete control. It also gives you complete responsibility.
Cache-aside is the foundation for understanding other caching patterns. The read-through and write-through patterns we cover next automate parts of what cache-aside does manually.