DynamoDB interview question · Most asked

What are DynamoDB Streams, and how are they used?

Summary

DynamoDB Streams is an ordered, time-ordered log of item-level changes (new image, old image, or both) retained for 24 hours. Lambda functions or other consumers read it to react to changes: update aggregates, sync search indexes, send notifications, replicate data, or implement an outbox.

Longer Answer

Ordering is guaranteed per item (per partition key, within a shard), not across the table. Delivery to Lambda is at least once, so consumers must be idempotent. Failed batches are retried and block the shard until they succeed or expire, so configure bisecting on error, maximum retry attempts and an on-failure destination (DLQ). Kinesis Data Streams for DynamoDB is an alternative with longer retention and more consumers.

Key Points

  • 24-hour change log with images.
  • Ordered per item, at-least-once.
  • Idempotent consumers; DLQ for poison batches.
  • Kinesis option for longer retention.

Deep dive: Node.js Serverless on AWS Lambda: DynamoDB Streams and poison records

More most-asked DynamoDB questions

← All DynamoDB questions