Common Caching Patterns
Learn popular caching patterns like Cache-Aside, Read-Through, Write-Through, and Write-Back, and when to apply each.
Intro to Caching Patterns
Welcome! In this lesson, we'll explore common caching patterns. These patterns are structured ways your application interacts with a cache to improve performance and manage data.
Think of them as blueprints for how data flows between your application, the cache, and the main data store (like a database).
Cache-Aside: The Basics
Cache-Aside (also known as Lazy Loading) is a very popular caching pattern. In this approach, your application is responsible for directly managing the cache.
- The application checks the cache first for data.
- If data is found (a "cache hit"), it's returned immediately.
- If data is not found (a "cache miss"), the application fetches it from the database, stores it in the cache, and then returns it.
All lessons in this course
- Common Caching Patterns
- Cache Invalidation Strategies
- Cache Eviction Policies
- Defending Against the Thundering Herd