Question 830
For this Azure AI backend: A hot RAG prompt-cache key expires during peak traffic and hundreds of workers regenerate the same embedding concurrently. Which corrective design should the engineer implement?
Explanation
Correct Answer
Add a bounded distributed lock or staggered expirations with safe fallback. The scenario specifically states: A hot RAG prompt-cache key expires during peak traffic and hundreds of workers regenerate the same embedding concurrently. A single-flight lock or expiration jitter can reduce synchronized cache regeneration bursts. This change targets the named service and constraints rather than a different workflow. Validate the result by checking Under simultaneous synthetic misses only one approved regeneration occurs per key. The important remaining qualification is: A lock must expire safely or failures can leave the key unavailable.
Incorrect Answers
Cache-aside implementations read the source of truth on miss and populate cache for future access. That addresses a different mechanism; this question turns on Add a bounded distributed lock or staggered expirations with.
Supported Redis search predicates can combine vector ranking with metadata constraints. In the present case the governing issue is A single-flight lock or expiration jitter can reduce synchronized, which this does not resolve.
Azure Managed Redis can cache reusable results with a bounded TTL to reduce repeated backend work. That observation may hold without resolving the relevant issue: Add a bounded distributed lock or staggered expirations with.