DynamoDB Streams Exam Tips
A DynamoDB Stream is a time-ordered sequence (stream) that records item level modifications (insert, update, delete)
- Logs are encrypted at rest and stored for 24 hours
- Accessed using a dedicated endpoint. There's one for the DB table itself and a separate one for the stream.
- By default, the Primary Key is recorded (at minimum)
- Before and After images can be captured
- Can be used for auditing, replaying transactions to another table, or triggering events based on particular change.
- Because of the ability to trigger events based on particular change types, DynamoDB streams are great for serverless architecture.
Processing DynamoDB Streams
- Events are recorded in near real-time
- Applications can take actions based on contents
- Event source for Lambda
- Lambda polls the DynamoDB stream
- Executes Lambda code based on a DynamoDB Streams event
Using DynamoDB Streams To Trigger A Workflow
- A Lambda Function sees an INSERT, UPDATE, or DELETE event in a stream.
- The function triggers an SNS, which in turn yields a message in an SQS queue
- A payments application polls the SQS queue, process the message, and then add an item to a customer's bill