- 최신
- 최다 투표
- 가장 많은 댓글
DynamoDB Streams guarantees exactly once deliver of all mutations to items in the table. This is done by using the internal log sequence number in DynamoDB which is unique to every modification.
While it may seem that both mutations happened at the same time on the client side, each of those mutations carry a unique log sequence number, which ensures they all make it to the stream exactly once.
Exactly once delivery:
PUT item (LSN=001) on stream ONLY IF item (LSN=001) NOT EXISTS
Item ordering:
PUT item (LSN=002) on stream ONLY IF item (LSN=001) EXISTS
Streams and their behaviour is documented here
A DynamoDB stream is an ordered flow of information about changes to items in a DynamoDB table. When you enable a stream on a table, DynamoDB captures information about every modification to data items in the table.
Whenever an application creates, updates, or deletes items in the table, DynamoDB Streams writes a stream record with the primary key attributes of the items that were modified. A stream record contains information about a data modification to a single item in a DynamoDB table. You can configure the stream so that the stream records capture additional information, such as the "before" and "after" images of modified items.
DynamoDB Streams helps ensure the following:
Each stream record appears exactly once in the stream.
For each item that is modified in a DynamoDB table, the stream records appear in the same sequence as the actual modifications to the item
See : https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 일 년 전
Beyond this if you are worried about race conditions I suggest you consider DynamoDB transation during the write event https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/transaction-apis.html