Alberto Cubeddu
The Startup
Published in
5 min readAug 15, 2019

--

AWS DynamoDB Triggers (Event-Driven Architecture)

DynamoDB Streams

There are a lot of implementations to achieve event-driven architecture. However, today, we will focus on DynamoDB Streams. Thanks to this NoSQL database, you can leverage the power of a schemaless database and, simultaneously, the event-driven architecture pattern.

An example of this architecture is represented in the screenshot above us, where you have your System (“The Producer”) creating JSON Payload(s) that are sent to DynamoDB. After arrival, DynamoDB Trigger will execute the Lambda functions called consumers(*).

Whenever an item in the table is created/modified or deleted, a new stream record is written, which triggers the Lambda function and causes it to execute.

DynamoDB Triggers Interface (from the WEB UI)

(*) The recommended number of lambda functions per stream is 2; However, as you can imagine, having just two can’t be enough. That’s why I decided to have one lambda as a data lake and leave the other as a generic consumer for fan-out.

DynamoDB Stream — Explanation

The stream is a feature that allows DynamoDB to write any action as a series of events dispatchable to a consumer whenever…

--

--

Alberto Cubeddu
The Startup

Leadership || Management || Innovation - Technology Director & Former Head Of Engineering