Skip to content

Latest commit

 

History

History
27 lines (16 loc) · 1.88 KB

README.md

File metadata and controls

27 lines (16 loc) · 1.88 KB

The Dynamo Streamer

The Dynamo Streamer pattern was taken from from this Tweet by Eric Johnson. He later went on to use this pattern to build a lambdaless, serverless url shortener.

This is a variation on The Simple Webservice pattern from Jeremy Daly only instead of a lambda being connected to the apigateway, the dynamodb is connected directly and the api gateway uses templates to transform the incoming message to insert the data. A lambda then listens for events coming from dynamodb streams and can be used to do data transforms after insertion meaning if an error occurs you lose no data.

"When thinking about #Serverless architectures, consider how much of your processing can happen AFTER the data is saved. Thinking asynchronously can lead to greater resiliency and often, less code."

Architecture

How To Test Pattern

After deployment you will have an API Gateway with one endpint (/InsertItem) that takes an application/json payload via POST. It will insert the contents of the message field into DynamoDB where that new event will be streamed to a Lambda that will print the contents to the console. To see the full flow you need to look in the AWS Console and look in DynamoDB and the Lambda Cloudwatch logs

JSON Payload Format

{ "message": "hello" }

Example Request

Postman

Available Versions