AZ-204 · Question #27
AZ-204 Question #27: Real Exam Question with Answer & Explanation
Optimistic concurrency in Azure Blob Storage uses ETags to detect conflicting changes without locking resources. The correct sequence is: (1) Retrieve the blob to get its ETag from the response headers, (2) Store the ETag and let the user modify the image, (3) When uploading, inc
Question
Drag and Drop Question You are creating a collaborative image hosting platform as an ASP.NET MVC web application. Users add, update, and modify images on the platform. Images are stored in Azure Blob storage. More than one user at a time must be able to modify the same image. You need to implement optimistic concurrency for uploading images. Which four actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. NOTE: Each correct solution is worth one point. Answer:
Explanation
Optimistic concurrency in Azure Blob Storage uses ETags to detect conflicting changes without locking resources. The correct sequence is: (1) Retrieve the blob to get its ETag from the response headers, (2) Store the ETag and let the user modify the image, (3) When uploading, include the ETag in the If-Match conditional header of the PUT BLOB request so Azure only accepts the update if the blob hasn't changed since retrieval, (4) Check the response - HTTP 200 means success, HTTP 412 (Precondition Failed) means another user modified the blob concurrently. This pattern allows multiple users to attempt edits simultaneously while preventing silent overwrites of each other's changes.
Topics
Community Discussion
No community discussion yet for this question.