WAF Cache-Aside Pattern

June 24, 2025273 words2 min read
azure
design patterns
reliability
performance efficiency

WAF Cache-Aside Pattern

CategoryDescriptionWAF Description
WhatA 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 withRead-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.
WhenWhen 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 ForScenarios 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 ToWrite-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

If you want to get in touch and hear more about this topic, feel free to contact me on or via .

© 2025 Andrei Bodea