問題文
Two back-office users often open the same customer record in a web application and save it within a few seconds of each other, and the second save silently overwrites the first. The architect wants to detect this using what HTTP already provides, without adding a lock table or a queue in front of the API. What should the API do?
選択肢
- Return a change history with the record and require the caller to replay it before the update so that the caller can merge a stale copy
- Return a sequence number with the record and require the caller to send it back on the update so that the API can renumber a save made against a stale copy
- Return an entity tag with the record and require the caller to send it back on the update so that the API can reject a save made against a stale copy
- Return a modification timestamp with the record and require the caller to compare it locally before the update so that the caller can abandon a stale copy