1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
1
While all writes to DynamoDB are strongly consistent, I believe what you want is the item as it was directly after the update. One such solution is what you mention, a strongly consistent read directly after the update, which will cost you an additional read request.
I believe the best way to do this is to use the ReturnValues
parameter of the UpdateItem
API:
Use ReturnValues
if you want to get the item attributes as they appear before or after they are successfully updated. For UpdateItem, the valid values are:
NONE
- If ReturnValues is not specified, or if its value is NONE, then nothing is returned. (This setting is the default for ReturnValues.)ALL_OLD
- Returns all of the attributes of the item, as they appeared before the UpdateItem operation.UPDATED_OLD
- Returns only the updated attributes, as they appeared before the UpdateItem operation.ALL_NEW
- Returns all of the attributes of the item, as they appear after the UpdateItem operation.UPDATED_NEW
- Returns only the updated attributes, as they appear after the UpdateItem operation.
There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.
관련 콘텐츠
- AWS 공식업데이트됨 10달 전
- AWS 공식업데이트됨 일 년 전