# Testing Your DynamoDB Stream

# What is DynamoDB Stream

DynamoDB is a fantastic NoSQL database from AWS. It's a managed service that deeply integrates with the rest of the AWS ecosystem. One of the most useful integrations is the integration between DynamoDB and Lambda. DynamoDB has the ability to stream some data into your Lambda. This allows you to run some business logic as your data changes. A common use-case for this technique is sending an email from a lambda when you record gets saved in a DynamoDB table.

# DynamoDB Stream Tester Overview

Once you connected your DynamoDB tables to your Lambdas you need to make sure it works as expected. Doing so is very straightforward using Commandeer. Commandeer has a tester tool allowing you to test your DynamoDB streams. It saves your DynamoDB record and watches for a lambda invocation.

Dynamo stream tester interface

You can navigate to the tester from several places.

  • Side navigation under a connected Lambda
  • Side navigation under a connected Dynamo table
  • Dynamo stream widget on Dynamo Table Dashboard

Since all 3 pieces of the DynamoDB plumbing are deeply inner connected, Dynamo Stream Tester allows you to navigate to each part of it at the top. Clicking on View in CloudWatch opens CloudWatch Logs for the connected lambda. Clicking View DynamoDB Table opens the table Dashboard, and the View Lambda button goes to the Lambda dashboard for the lambda in question.

Here you can also refresh your test results, set the poll timeout in the settings, and view the documentation.

# Running Your DynamoDB Stream Test

Navigate to the stream of your choice, and click Run. The tester saves a new record into the table and starts watching for Lambda logs. Once the Lambda logs are detected, you'll be able to inspect them in the results panel on the right. The UI also has the ability to filter your logs, as well as the ability to copy and share your lambda logs with your colleagues.

# Conclusion

Using DynamoDB streams allows you to execute some custom business logic as your data changes. It's especially useful when you need to trigger some actions in the background. With DynamoDB Stream Tester, you can easily test your connection between DynamoDB stream and your Lambda. It saves a test payload and lets you inspect the Lambda invocation logs. Go ahead and give Commandeer a shot to become more productive.

Download Commandeer