0Pricing
AWS for Backend Developers (EC2, S3, RDS, Lambda) · Lesson

DynamoDB Streams and Global Tables

Learn how to react to data changes in real time with DynamoDB Streams and build multi-region, low-latency applications using Global Tables.

DynamoDB Streams and Global Tables is a free AWS for Backend Developers (EC2, S3, RDS, Lambda) lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS for Backend Developers (EC2, S3, RDS, Lambda) learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Reacting to Changes

Sometimes you need to know the moment data changes — to update a cache, send a notification, or sync another system.

DynamoDB Streams capture an ordered log of every item-level change in a table.

What a Stream Records

Each stream record describes an INSERT, MODIFY, or REMOVE. You choose what data the record carries via the stream view type:

  • KEYS_ONLY
  • NEW_IMAGE
  • OLD_IMAGE
  • NEW_AND_OLD_IMAGES

Enabling a Stream

Enable a stream on a table and pick a view type.

aws dynamodb update-table \
  --table-name Orders \
  --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES

Streams Trigger Lambda

The most common pattern is connecting a stream to a Lambda function. Lambda is invoked in batches as records arrive, letting you process changes serverlessly.

exports.handler = async (event) => {
  for (const record of event.Records) {
    console.log(record.eventName, record.dynamodb.Keys);
  }
};

Common Stream Use Cases

Streams power many patterns:

  • Keeping a search index (OpenSearch) in sync
  • Aggregating analytics
  • Sending notifications on changes
  • Replicating to another data store

Ordering and Shards

Streams are organized into shards. Records within a shard are strictly ordered by the sequence in which changes occurred, which preserves per-item change order.

Introducing Global Tables

Global Tables replicate your DynamoDB table across multiple AWS regions automatically, giving users low-latency access no matter where they are.

Multi-Region, Active-Active

Global Tables are active-active: you can read and write in any region, and changes replicate to the others, typically within a second.

Global Tables are built on top of DynamoDB Streams under the hood.

Conflict Resolution

When the same item is written in two regions at once, DynamoDB resolves the conflict using a last writer wins strategy based on timestamps.

When to Use Global Tables

Reach for Global Tables when you need:

  • Low latency for a worldwide user base
  • Regional disaster recovery
  • Multi-region active-active applications

Streams vs Global Tables

Remember the distinction:

  • Streams — react to changes within your own systems
  • Global Tables — replicate the table itself across regions

Global Tables use Streams internally to do their work.

Quick Check

Test your DynamoDB knowledge.

Recap

You learned advanced DynamoDB features:

  • Streams capture ordered item-level changes
  • Streams commonly trigger Lambda
  • Global Tables replicate active-active across regions
  • Conflicts resolve with last writer wins

Together they enable real-time, globally distributed applications.

Frequently asked questions

Is the “DynamoDB Streams and Global Tables” lesson free?

Yes — the full text of “DynamoDB Streams and Global Tables” is free to read here on the web, and the AWS for Backend Developers (EC2, S3, RDS, Lambda) course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS for Backend Developers (EC2, S3, RDS, Lambda) course, upgrade to CoddyKit PRO.

What will I learn in “DynamoDB Streams and Global Tables”?

Learn how to react to data changes in real time with DynamoDB Streams and build multi-region, low-latency applications using Global Tables. You practise AWS for Backend Developers (EC2, S3, RDS, Lambda) with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AWS for Backend Developers (EC2, S3, RDS, Lambda)?

No prior experience is required. AWS for Backend Developers (EC2, S3, RDS, Lambda) on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “DynamoDB Streams and Global Tables” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AWS for Backend Developers (EC2, S3, RDS, Lambda) lesson?

Yes. Every AWS for Backend Developers (EC2, S3, RDS, Lambda) lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. RDS Read Replicas and Multi-AZ
  2. Introduction to DynamoDB
  3. DynamoDB Data Modeling
  4. DynamoDB Streams and Global Tables
← Back to AWS for Backend Developers (EC2, S3, RDS, Lambda)