Working with a cache
The caching service has been growing faster than in the past due to the growing need for building large-scale web applications. In this section, we talk about the two in-memory caching options supported by Azure: the Azure Managed Cache and the Redis Cache.
Modern software architectures often rely on an in-memory caching system to save frequently accessed data that do not change too often. Some extreme scenarios require us to use the in-memory cache as the primary data store for sensitive data, pursuing design patterns oriented to eventual persistence and consistency.
It is evident that in both cases, the caching service must be protected properly to avoid data loss:
- Cache as copy of frequently accessed data:
- In case of a malicious deletion, at the first cache miss, the cache generator (the code or some batch procedures) needs to again fetch the current data from the data store, causing a performance delay
- In case of a malicious modification, the code can behave in unexpected...