A DynamoDB Stream is enabled by updating the DynamoDB table.
When you configure a DynamoDB Stream you can choose what data is sent into the stream. The less you send in the stream the less read capacity units consumed.
| View Type | Description |
|---|---|
| KEYS_ONLY | Only the keys are sent into the event. |
| NEW_IMAGE | The entire new version of the item in DynamoDB |
| OLD_IMAGE | The entire old version of the item in DynamoDB |
| NEW_AND_OLD_IMAGES | Both the old and new versions of the item are sent in the event payload |
For our use case we need both the old and new versions of the item to compare any changes to the task assignments.
Like updating a table's provisioning, when enabling a stream it will change the status of the table to updating while the service provisions the stream. The table will be accessible while the stream is being enabled.
This code below is simplistic version of what it takes to read from a DynamoDB stream. It does does not
handle failures and scaling concerns. When we use Lambda to handle reading from a DynamoDB Stream all we have to write
is our business logic in the foreach for the shardReader Func<>. Lambda takes care of managing the scaling and failures
for the shards of a DynamoDB Stream.
- Getting Started
- What is a serverless application?
- Common AWS Serverless Services
- What are we going to build in this tutorial?
- TODO List AWS Services Used
- Using DynamoDB to store TODO Lists
- Handling service events with Lambda
- Getting ASP.NET Core ready for Serverless
- Deploying ASP.NET Core as a Serverless Application
- Tear Down
- Final Wrap Up
Continue on to next page: Assign Task Lambda Function