Choose what a change record contains
How stream views, shards, record retention, and per-item ordering govern consumption of table changes and handling of duplicate deliveries. · associate
DynamoDB Streams captures item-level changes after you enable it on a table. Records identify changes as INSERT, MODIFY, or REMOVE. An update that leaves the item's data unchanged does not produce a stream record. Enabling a stream does not produce an initial snapshot of existing items.
The stream view type determines the item data captured in each record. Every view includes the item's primary key attributes. An image is the item's complete set of attributes before or after the change, not just the attributes that changed.
Choose the view from the consumer's needs: keys to identify an item, a new image to use its changed state, an old image to inspect its previous state, or both images to compare them. Images exist only where applicable: an insert has no old image, and a removal has no new image.
| Stream view | Keys | Item images |
|---|---|---|
| KEYS_ONLY | Included | None |
| NEW_IMAGE | Included | After the change |
| OLD_IMAGE | Included | Before the change |
| NEW_AND_OLD_IMAGES | Included | Before and after |