michelangelus - Fotolia

Amazon DynamoDB Streams and AWS Lambda -- better together

New possibilities have opened up for cloud users now that the Amazon DynamoDB NoSQL database and AWS Lambda can be used together.

A feature for the Amazon DynamoDB NoSQL database as a service means users can link it with AWS Lambda, opening...

up new uses for both technologies.

The Streams feature for Amazon DynamoDB provides a time-ordered log of all item-level changes made to any DynamoDB table exposed through the Amazon Kinesis interface.

The feature solves a problem with the NoSQL database as a service, which made it difficult for users to keep DynamoDB data in sync with other data sources, such as search indices or data warehouses, according to a blog by Amazon CTO Werner Vogels. It also enables cross-region replication of data changes for Amazon DynamoDB for the first time.

But what has IT pros especially interested in Amazon DynamoDB Streams is the ability to have stream data trigger AWS Lambda functions, effectively translating a relational database feature, "triggers," into the NoSQL world. In other words, AWS Lambda can now watch changes to DynamoDB tables exposed through Kinesis, which can kick off processes based on those changes.

"I've been hammering them to make [Streams] available because it lets me glue together Lambda and DynamoDB -- and that makes the two services far more powerful than either is independently," said Jason McMunn, chief cloud architect at Ditech Mortgage Corp., based in Fort Washington, Pa.

For example, McMunn's team has a DynamoDB table that's constructed to take data from a change management database system, keeping track of data center assets. Now, the team can have Lambda watch that and take actions, such as updating downstream documentation and producing reports.

Another possible application for the combination of Amazon DynamoDB and AWS Lambda is data analytics, McMunn said. Ditech currently takes in data from third-party sources -- such as Zillow Inc. -- and connects it to internal APIs, then puts the output into a DynamoDB table. The connection to Lambda means McMunn's team doesn't have to run any external middleware to facilitate connectivity between different APIs.

As other IT pros have remarked, Lambda, in turn, allows event-driven computing that doesn't rely on an always-on farm of Elastic Compute Cloud instances, according to Dan Sullivan, a systems architect, consultant and TechTarget contributor.

"The nice thing with Lambda is that you don't have to have servers up and running all the time, basically spinning and waiting for something to happen so that you have the program always available to execute," Sullivan said.

Other potential applications for Amazon DynamoDB Streams include syncing files across multiple AWS regions for collaborative work, sensor data tracking from the Internet of Things and synchronizing mobile applications, Sullivan said.

While database triggers aren't unique in the relational database or NoSQL world -- customers of other NoSQL databases can use utilities, such as ActiveMQ, to perform similar functions -- Amazon's technology combo is distinct.

 "I don't know of another case where it combines with something like Lambda, which gives you a really easy platform to work with in terms of implementing code to execute in response to the particular events," Sullivan said.

All of this, along with the database as a service becoming HIPAA-eligible, will probably drive more users to Amazon DynamoDB, Sullivan predicted.

"Dynamo definitely has a niche," Sullivan said. "It's not going to replace relational databases, but it's going to be around for a while."

Beth Pariseau is senior news writer for SearchAWS. Write to her at [email protected] or follow @PariseauTT on Twitter.  

Next Steps

Rackspace users turn to Amazon RDS

How much does AWS Lambda cost?

DynamoDB and mobile app development

Dig Deeper on AWS database management