Implementing Basic Cache Patterns
Learn to implement Cache-Aside and Write-Through patterns using Redis for common application data.
Basic Cache Patterns Intro
Welcome! In this lesson, we'll dive into two fundamental caching patterns: Cache-Aside and Write-Through. These patterns help you integrate Redis into your applications to store and retrieve data efficiently.
Understanding them is key to building responsive and scalable systems.
What is Cache-Aside?
The Cache-Aside pattern is one of the most common ways to use a cache. Here, your application is responsible for managing both the cache and the primary data store (like a database).
- When reading data, the app first checks the cache.
- If found (a 'cache hit'), it returns the cached data.
- If not found (a 'cache miss'), it fetches the data from the database, stores it in the cache, and then returns it.
All lessons in this course
- Why Cache? Introduction to Caching
- Implementing Basic Cache Patterns
- Cache Eviction and Expiration
- Preventing Cache Stampedes and Thundering Herds