DEV Community

Cover image for Replicating DynamoDB to Amazon Redshift: A Zero-ETL Engineering Guide
Aniket Abhishek Soni
Aniket Abhishek Soni

Posted on AI-assisted

Replicating DynamoDB to Amazon Redshift: A Zero-ETL Engineering Guide

You build a high-performance DynamoDB table for your application's state, but soon enough, your product team asks for complex analytical queries that DynamoDB simply wasn't designed to handle. You consider writing a custom Lambda-based ETL job to sync data to Amazon Redshift, but you quickly realize the maintenance burden: schema evolution, backfills, and handling stream latency. Instead, you turn to Amazon DynamoDB zero-ETL integration with Amazon Redshift to bridge the gap.

This article explains the mechanics of how data moves from DynamoDB to Redshift, how to configure the integration, and the critical limitations regarding what actually replicates. This guide focuses on the operational reality of the integration, covering configuration via the AWS CLI and the nuances of data types.

Why this matters: Zero-ETL removes the need to write and maintain custom pipelines for common analytical tasks. Understanding what does not replicate is vital to prevent silent data loss in your downstream analytics environment.

What you'll build

You will configure a zero-ETL integration that streams data from an existing DynamoDB table into a target Redshift Serverless workgroup, ensuring that your operational data is available for SQL-based analysis without manual pipeline management.

flowchart LR
    ddb["Amazon DynamoDB"]
    int["Zero-ETL Integration"]
    rs["Amazon Redshift Serverless"]

    ddb --> int
    int --> rs

Prerequisites

  • An AWS account with existing resources: an Amazon DynamoDB table with Point-in-Time Recovery (PITR) enabled and a Redshift Serverless workgroup.
  • The AWS CLI v2 installed and configured.
  • IAM permissions to manage dynamodb:DescribeTable, redshift:CreateIntegration, and redshift-serverless:GetWorkgroup.

Step 1: Prepare the source and destination

Before creating the integration, ensure your DynamoDB table has PITR enabled, as this is a strict requirement for the zero-ETL process. You must also ensure your Redshift workgroup allows the integration to connect.

To verify PITR status for your table:

aws dynamodb describe-continuous-backups \
    --table-name <your-table-name> \
    --query "ContinuousBackupsDescription.PointInTimeRecoveryDescription.PointInTimeRecoveryStatus"
Enter fullscreen mode Exit fullscreen mode

If the output is DISABLED, enable it:

aws dynamodb update-continuous-backups \
    --table-name <your-table-name> \
    --point-in-time-recovery-specification PointInTimeRecoveryEnabled=true
Enter fullscreen mode Exit fullscreen mode

Step 2: Create the integration

The integration acts as the bridge. You do not need to move data manually; once created, the integration automatically starts replicating existing data and subsequent changes.

Use the following command to create the integration:

aws redshift create-integration \
    --source-arn <your-dynamodb-table-arn> \
    --target-arn <your-redshift-workgroup-arn> \
    --integration-name <your-integration-name>
Enter fullscreen mode Exit fullscreen mode

Verify the status using:

aws redshift describe-integrations \
    --integration-arn <your-integration-arn>
Enter fullscreen mode Exit fullscreen mode

Look for the Status field; it should transition from CREATING to ACTIVE.

Step 3: Map data to Redshift

DynamoDB is schemaless, while Redshift requires a schema. The integration automatically maps DynamoDB attributes to Redshift columns. Because DynamoDB data types can be nested (Maps, Lists), the integration maps these to Redshift SUPER data types.

Access the data in Redshift by querying the automatically created schema:

-- Replace 'source_table' with your actual DynamoDB table name
SELECT * FROM "integration_schema"."source_table" LIMIT 10;
Enter fullscreen mode Exit fullscreen mode

If you need to extract specific nested fields from the SUPER column, use the JSON_EXTRACT_PATH_TEXT function or standard dot notation.

Design decisions

  • Zero-ETL, not Lambda-based streaming. Zero-ETL removes the operational overhead of managing concurrency, error retries, and checkpointing. Choose custom Lambda pipelines only when you require complex data transformation or filtering before the data lands in Redshift.
  • SUPER types, not flat columns. DynamoDB's flexible schema is inherently stored in SUPER columns in Redshift. While you could perform a VIEW on top of these to flatten them, doing so requires constant maintenance if your DynamoDB schema evolves.
  • PITR, not just Stream-based replication. The integration relies on the underlying storage layer, not just DynamoDB Streams. This ensures that even if you miss a stream event, the integration reconciles the state.

Troubleshooting

  • Integration stuck in 'CREATING': This often happens if the source table does not have PITR enabled or if there is a regional mismatch. Verify that both the DynamoDB table and Redshift workgroup reside in the same Region.
  • Data not appearing in Redshift: Check the State of the integration. If it is FAILED, use describe-integrations to check the Errors field. Common causes include insufficient permissions for Redshift to access the DynamoDB table.
  • Schema mismatch errors: If you change your DynamoDB item structure drastically, the integration may struggle to map new attributes to existing columns. You may need to refresh the integration or check the Redshift logs for data type conflicts.

Clean up

To stop incurring costs for the integration and associated resources:

  1. Delete the integration:
   aws redshift delete-integration --integration-arn <your-integration-arn>
Enter fullscreen mode Exit fullscreen mode
  1. Disable PITR if it is no longer required for your table:
   aws dynamodb update-continuous-backups \
       --table-name <your-table-name> \
       --point-in-time-recovery-specification PointInTimeRecoveryEnabled=false
Enter fullscreen mode Exit fullscreen mode

Conclusion

You now have an automated, low-latency pipeline moving operational data from DynamoDB to Redshift without writing custom ingestion code. The key trade-off is the use of SUPER types, which require a shift in how you write your SQL queries compared to standard flat tables. As a next step, I recommend setting up Amazon CloudWatch alarms on the IntegrationStatus metric to ensure your replication remains healthy as your data volume grows.

Try it: Configure a test integration in a sandbox environment and attempt to insert an item into your DynamoDB table with a deeply nested Map to observe how it renders in your Redshift SUPER column.


Tags: #aws #database #dynamodb #redshift

About the examples: automated checks confirmed that 6 AWS CLI commands match the AWS service API models (operation and parameter names). The examples have not been run end to end, so test them in a non-production environment before relying on them.

Cover photo by Albert Stoynov on Unsplash.


This article was drafted with AI assistance and is intended for technical review and fact-checking before publication.

Top comments (0)