# Cache-Aside

> Load data on demand into a cache from a data store

- **Category**: Cloud
- **Subcategory**: azure
- **Canonical URL**: https://designpattern.fyi/patterns/azure_cache_aside/

---

## Description
The Cache-Aside pattern loads data on demand into a cache from a data store. The application first checks the cache for the requested data. If the data is not in the cache, the application retrieves it from the data store and stores it in the cache for future requests. This pattern provides performance benefits by reducing direct data store access.


## Use Cases
Use when you want to improve performance by caching frequently accessed data or when data store access is expensive.





## Trade-offs


### Advantages

- Improved performance through caching

- Reduced load on data store

- On-demand loading prevents unnecessary caching

- Simple to implement




### Considerations & Drawbacks

- Cache staleness issues

- Requires cache invalidation strategy

- Additional cache infrastructure







---
**Reference**: [Original Source](https://learn.microsoft.com/en-us/azure/architecture/patterns/cache-aside)

