DynamoDB Streams Interview Questions

Master Amazon DynamoDB Streams with interview-focused questions covering Change Data Capture (CDC), Stream View Types, Lambda Integration, Event-Driven Architecture, EventBridge, SNS, SQS, CQRS, Auditing, Replication, and production best practices.

Introduction

Modern applications are increasingly built using Event-Driven Architecture (EDA), where changes in one system automatically trigger actions in other systems.

DynamoDB Streams enables this by capturing every data modification in a DynamoDB table and publishing those changes as a stream of events.

Streams are commonly used for

  • Event-Driven Applications
  • Audit Logging
  • Cache Synchronization
  • Search Index Updates
  • Analytics
  • Notifications
  • CQRS
  • Microservices Communication

This guide covers the most frequently asked DynamoDB Streams interview questions.


DynamoDB Streams Architecture

flowchart LR

Application --> DynamoDB

DynamoDB --> DynamoDBStreams

DynamoDBStreams --> Lambda

Lambda --> SNS

Lambda --> SQS

Lambda --> EventBridge

Lambda --> OpenSearch

Lambda --> AuditDB

1. What are DynamoDB Streams?

Answer

DynamoDB Streams capture every data modification made to a DynamoDB table.

Captured events include

  • INSERT
  • MODIFY
  • REMOVE

Applications can consume these events for downstream processing.


2. Why are DynamoDB Streams used?

Streams allow applications to react automatically whenever data changes.

Common uses

  • Notifications
  • Search Index Updates
  • Event Processing
  • Cache Updates
  • Auditing
  • Analytics

3. What operations generate stream events?

Every item modification generates an event.

Supported operations

  • INSERT
  • MODIFY
  • REMOVE

Stream Flow

flowchart LR

Insert --> Stream

Modify --> Stream

Delete --> Stream

Stream --> Consumer

4. What is Change Data Capture (CDC)?

CDC is the process of capturing database changes and publishing them as events.

Instead of polling the database,

Applications subscribe to change events.


5. Does DynamoDB Streams affect application performance?

No.

Streams are generated asynchronously.

Application writes complete independently.


6. What information does a Stream record contain?

A stream record includes

  • Event ID
  • Event Name
  • Table Name
  • Keys
  • Old Image
  • New Image
  • Timestamp

7. What are Stream View Types?

DynamoDB supports four view types.

  • KEYS_ONLY
  • NEW_IMAGE
  • OLD_IMAGE
  • NEW_AND_OLD_IMAGES

Stream View Types

flowchart LR

Stream --> KEYS_ONLY

Stream --> NEW_IMAGE

Stream --> OLD_IMAGE

Stream --> NEW_AND_OLD_IMAGES

8. Explain KEYS_ONLY.

Contains only

  • Primary Key
  • Sort Key

Smallest event size.


9. Explain NEW_IMAGE.

Contains

New item after modification.

Useful for

  • Notifications
  • Search Index Updates

10. Explain OLD_IMAGE.

Contains

Old item before modification.

Useful for

  • Auditing
  • Rollback
  • Historical Analysis

11. Explain NEW_AND_OLD_IMAGES.

Contains

  • Previous Version
  • Updated Version

Useful for

  • Auditing
  • Change Comparison
  • Event Processing

12. Which Stream View Type is most commonly used?

NEW_AND_OLD_IMAGES

Provides complete change history.


13. How long are stream records retained?

Current retention period

24 Hours

Applications should process records promptly.


14. Can DynamoDB Streams be disabled?

Yes.

Streams can be

  • Enabled
  • Disabled

at any time.


15. Can Streams be re-read?

Yes.

Consumers maintain checkpoints.

Unprocessed records remain available until retention expires.


16. Can multiple consumers read the same stream?

Yes.

Multiple consumers can process the same events independently.


Stream Consumers

flowchart LR

Streams --> Lambda

Streams --> Analytics

Streams --> Audit

Streams --> Notification

17. How does Lambda integrate with Streams?

Lambda automatically polls DynamoDB Streams.

Whenever new events appear,

Lambda executes.

No polling code is required.


Lambda Flow

flowchart LR

DynamoDB --> Streams --> Lambda --> BusinessLogic

18. Can one stream invoke multiple Lambdas?

Yes.

Multiple Lambda functions can process different business logic.

Example

  • Audit
  • Notifications
  • Analytics
  • Search Index

19. What is Event-Driven Architecture?

Applications communicate using events instead of direct API calls.

Benefits

  • Loose Coupling
  • Better Scalability
  • Faster Development

Event-Driven Architecture

flowchart LR

OrderService --> Streams --> NotificationService

Streams --> AnalyticsService

Streams --> InventoryService

20. Can Streams publish to EventBridge?

Yes.

Typical flow

Streams

↓

Lambda

↓

EventBridge

Useful for enterprise event routing.


21. Can Streams publish to SNS?

Yes.

Lambda forwards events to SNS.

SNS

Email

SMS

Mobile Push


22. Can Streams publish to SQS?

Yes.

Useful for

  • Retry
  • Buffering
  • Asynchronous Processing

23. Can Streams update OpenSearch?

Yes.

Typical architecture

DynamoDB

↓

Streams

↓

Lambda

↓

OpenSearch

Used for

  • Full Text Search
  • Product Catalog
  • Search APIs

24. Can Streams update Redis?

Yes.

Useful for

  • Cache Refresh
  • Cache Invalidation

25. What is CQRS?

CQRS

Command Query Responsibility Segregation

Commands update DynamoDB.

Streams synchronize read models.


CQRS Flow

flowchart LR

WriteModel --> DynamoDB --> Streams --> ReadModel

26. Banking Example

Transaction Created

Streams

Lambda

Fraud Detection

SMS Notification

Audit Database


27. E-Commerce Example

Order Placed

Streams

Inventory Update

Email Notification

Analytics

Shipment Processing


28. HR Example

Employee Updated

Streams

Payroll

Identity System

Audit Logs


29. Gaming Example

Player Score Updated

Streams

Leaderboard

Achievements

Notifications


30. IoT Example

Sensor Data Arrives

Streams

Analytics

CloudWatch

Alert Service


31. What happens if Lambda fails?

Lambda automatically retries.

Failures can be redirected to

  • Dead Letter Queue (DLQ)
  • Event Destinations

Retry Flow

flowchart LR

Streams --> Lambda

Lambda --> Success

Lambda

-.->Retry

Retry

-.->DLQ

32. What are common production use cases?

  • Audit Logging
  • Cache Synchronization
  • Search Index Updates
  • Notifications
  • Event Sourcing
  • CQRS
  • Analytics
  • Machine Learning Pipelines

33. Enterprise Best Practices

  • Use Lambda for lightweight processing.
  • Keep Lambda idempotent.
  • Enable DLQ for failures.
  • Monitor IteratorAge metric.
  • Avoid long-running Lambda executions.
  • Process events in batches.
  • Choose the appropriate Stream View Type.
  • Use EventBridge for complex routing.
  • Monitor retry failures.
  • Implement proper error handling.

Quick Revision

Topic Key Point
Streams Change Data Capture
Operations INSERT, MODIFY, REMOVE
Retention 24 Hours
Consumer Lambda
View Types 4
KEYS_ONLY Keys Only
NEW_IMAGE New Record
OLD_IMAGE Previous Record
NEW_AND_OLD_IMAGES Before & After
CQRS Read Model Synchronization
CDC Database Change Events
Retry Automatic
DLQ Failed Events

Interview Tips

Interviewers commonly ask

  • What are DynamoDB Streams?
  • Explain Change Data Capture.
  • Explain all Stream View Types.
  • How does Lambda integrate with Streams?
  • How do Streams support Event-Driven Architecture?
  • Explain CQRS using Streams.
  • Can Streams invoke multiple Lambda functions?
  • What happens if Lambda processing fails?
  • Give a banking use case for Streams.
  • Explain DynamoDB Streams vs EventBridge.

Always explain that Streams capture database changes, while Lambda processes those changes, enabling loosely coupled, event-driven microservices.


Summary

DynamoDB Streams provide a powerful Change Data Capture (CDC) mechanism that records every item modification and enables real-time event processing. Combined with AWS Lambda, EventBridge, SNS, SQS, and OpenSearch, Streams form the backbone of many event-driven architectures used in modern cloud-native applications.

Understanding Stream View Types, Lambda integration, CQRS, auditing, retries, and production event processing patterns is essential for designing scalable DynamoDB solutions and succeeding in AWS, backend engineering, and solution architect interviews.