AZ-305 Question 186
Single answerYou manage an e-commerce website hosted on Azure App Service with a SQL Database backend. The application experiences performance bottlenecks during peak shopping periods due to frequent reads on product and pricing data. You need to decrease response times and offload repetitive queries, while ensuring your solution scales automatically and supports features like time-to-live (TTL) for cached entries. Which solution should you implement?
- A
Use Azure Cache for Redis to store frequently accessed data in a distributed in-memory cache
- B
Enable read replicas on the Azure SQL Database to automatically distribute read requests
- C
Configure an Azure Storage account in the hot tier and reference product data via blob URLs
- D
Implement a custom caching layer on each App Service instance using local memory
Show answer and explanation
Correct answer: A
Explanation
Azure Cache for Redis is specifically designed for scenarios where high performance and low latency reads are required. It offloads repetitive database calls by storing the data in memory and provides features like time-to-live (TTL), replication, and autoscaling. This aligns with Microsoft’s recommendations for scalable caching patterns in Azure. See Microsoft documentation here: https://learn.microsoft.com/azure/azure-cache-for-redis/overview.
- A. Correct.
Option 1 is correct. Azure Cache for Redis provides a distributed in-memory cache, which can significantly reduce data retrieval times from the database. It supports TTL for cached items, autoscaling in higher tiers, and helps offload repetitive read requests from the backend database.
- B. Incorrect.
Option 2 is incorrect. While read replicas can distribute read traffic, they do not offer sub-millisecond latency or provide as much control over cache expiration policies. This approach also might still result in higher query costs under heavy load.
- C. Incorrect.
Option 3 is incorrect. Using Azure Storage in the hot tier is well-suited for object storage, not as a low-latency distributed cache. Access to blob storage is typically slower than in-memory caching solutions and not intended for frequent, real-time data retrieval.
- D. Incorrect.
Option 4 is incorrect. A custom local in-memory cache on each App Service instance would not be shared across the entire application, leading to cache inconsistency and increased management complexity as instances scale out.