Capture Changes with DynamoDB Streams and Process Them in a Lambda Consumer
Advanced · 45 minutes · 5 tasks, checked automatically · 100 points
In this advanced lab you will build a complete change-data-capture (CDC) pipeline entirely on the local AWS emulator. You will create a DynamoDB table with Streams enabled, write a Python Lambda function that reads stream records and writes a summary to an S3 bucket, wire the stream as an event-source mapping to the Lambda, and then drive real inserts and updates into the table to prove the pipeline works end-to-end. By the end you will understand how DynamoDB Streams expose ordered, per-item change logs and how Lambda consumers process those records in micro-batches.
What you’ll learn
- Create a DynamoDB table with Streams enabled (NEW_AND_OLD_IMAGES view type)
- Package and deploy a Python Lambda function that processes stream records and persists change summaries to S3
- Configure a DynamoDB Streams event-source mapping on the Lambda and verify end-to-end CDC delivery
How this lab works
- Start the lab: One click starts an emulated cloud on your computer, with the cloud’s own CLI ready: no account and no bill.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads the emulated cloud’s resources and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: An emulated cloud on your computer: no cloud account, no bill
- Cloud: AWS
- Services: dynamodb, lambda, s3, iam
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop (or Podman / Rancher Desktop) installed and running
- A AWS sandbox created in the Local Cloud Playground
Topics: dynamodb, dynamodb-streams, lambda, cdc, event-driven, s3, iam, python, streaming
Create a free account to start this lab.
Keep going
- Stream Pub/Sub Messages into BigQuery and Query the Results
- Cosmos DB Partition Key Design and Cross-Partition Query Optimization
- DynamoDB Batch & Transact Writes with boto3: Partial Failures and Retries
- Add a Global Secondary Index to a DynamoDB Table and Query It
- Prevent Lost Updates with DynamoDB Conditional Writes
- Datastore Ancestor Keys and Composite Index Queries