Speed layer

Our speed layer is the simplest part of the entire system. With the configuration in placea single Lambda function to execute whenever a new stream message arrivesthe only work we need to do is decode the data from the message payload, calculate the DynamoDB partition key, and write it to DynamoDB. The following code block shows all of this work in the single function, which is processing a single message from AWS Kinesis:

This code is all located in a single handler.py function, which goes against a best practice of splitting up application code and decoupling application logic from the cloud-specific bits. However, this application code is for demonstration purposes, and I can get away with breaking some rules for the sake ...

Get Serverless Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.