WAF Cache-Aside Pattern
June 24, 2025•273 words•2 min read•
azure
design patterns
reliability
performance efficiency
Category | Description | WAF Description |
---|---|---|
What | A caching strategy where the application code manages reading from and writing to the cache on demand. Data is pulled into the cache only as needed. | Improves performance efficiency by reducing direct calls to the data store and supports scalability by offloading repeated read operations to a faster in-memory store. |
Used with | Read-heavy applications that benefit from reduced database load, such as product catalogs, user profiles, and data with occasional updates. | Enables cost optimization by reducing pressure on backend databases and enhancing response time for frequently requested data. |
When | When you want fine-grained control over what gets cached and when, especially when cache storage and coherence logic must be explicitly controlled. | Supports operational excellence by allowing explicit cache lifecycle management, and reliability by improving fault tolerance under load. |
Not Suitable For | Scenarios requiring strong consistency between cache and data store, or high update frequency that would result in cache churn or staleness. | May conflict with reliability or consistency needs in systems where outdated data can have serious consequences or where write-through consistency is required. |
Related To | Write-Through Cache, Read-Through Cache, Distributed Caching, Expiration and Invalidation Patterns. | Reliable web app pattern, Caching Guidance, Data Consistency Primer |
A basic implementation of the Cache-Aside Pattern can be found here.
The full WAF description of the pattern can be found here