
Explanation:
* Comply with the defined expiration policy for recommendation results: Configure Time to Live on each cache key.
* Support the data integrity and freshness requirement for catalog updates: Publish invalidation events to a Redis channel.
* Meet the search latency target for recurring product requests: Implement cache-aside pattern with lazy loading.
The 10-minute expiration requirement should be implemented by configuring a Time to Live (TTL) on each Redis cache key. Redis automatically removes a key after its assigned expiration interval, ensuring recommendation results cannot remain cached indefinitely. Microsoft documents expiration as a standard mechanism for preventing cached data from becoming stale.
For catalog changes, Fabrikam explicitly requires a reactive invalidation mechanism . Publishing invalidation events to a Redis Pub/Sub channel allows application components to notify subscribers immediately when product metadata or pricing changes. Redis Pub/Sub broadcasts messages to channel subscribers, which can then invalidate affected cache entries instead of waiting for TTL expiration.
For repeated recommendation queries, implement the cache-aside pattern with lazy loading . The application first checks Redis; on a cache hit, results are returned from the low-latency in-memory cache. On a miss, the application retrieves data from PostgreSQL, places the result in Redis, and returns it. Microsoft identifies cache-aside as an appropriate pattern for frequently read data and explicitly notes that Azure Managed Redis provides low-latency, high-throughput access.
Redis RDB persistence is unnecessary for these requirements because the cache is an optimization layer rather than the authoritative data store.
Study Guide references: Azure Managed Redis # cache-aside pattern; TTL/expiration; Pub/Sub; cache invalidation and data freshness.
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).