Replicating Databases with AWS DMS and Change Data Capture
This lesson explains how AWS Database Migration Service (AWS DMS) migrates databases and continuously replicates their changes into AWS data stores, the standard way to bring operational data into a data lake or warehouse.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish full load, full load plus CDC and CDC-only tasks.
- Identify DMS sources and targets for data engineering.
- Choose between a replication instance and DMS Serverless.
- Configure the source database prerequisites for CDC.
Task types
An AWS DMS task performs one of three kinds of work. A full load copies the existing data once, which suits a one-off copy. A full load plus CDC copies the existing data and then keeps applying changes made to the source while the copy runs and afterwards, so the target stays current; this is how a database is migrated with minimal downtime, or kept in sync with a data lake. A CDC only task replicates changes from a chosen point in time, for example after an initial load made by another tool. The following table summarises the task types.
| Task | What it does |
|---|---|
| Full load | Copies existing data once |
| Full load plus CDC | Copies existing data, then keeps applying ongoing changes |
| CDC only | Replicates changes from a point in time |
Change data capture (CDC) reads the source's transaction log, capturing inserts, updates and deletes with little load on the source.
The following diagram shows what each task type does over time.

DMS task types
Sources and targets
AWS DMS reads from most commercial and open-source databases, such as Oracle, SQL Server, MySQL, PostgreSQL and MongoDB, whether on premises or in AWS. For data engineering, the most important targets are Amazon S3, where DMS writes CSV or Parquet files partitioned by date with an extra column that marks each row as an insert, update or delete, ready to be merged into a lake table; and Kinesis Data Streams or MSK, which turn database changes into a stream for real-time consumers. It can also load Redshift, Aurora, RDS, DynamoDB, OpenSearch and DocumentDB. The following table summarises the principal sources and targets.
| Sources | Targets |
|---|---|
| Oracle, SQL Server, MySQL, MariaDB, PostgreSQL, MongoDB, Db2, SAP ASE (on premises or in AWS) | Amazon S3 (CSV or Parquet, date-partitioned, with an operation column for inserts, updates and deletes), Redshift, Aurora, RDS, DynamoDB, Kinesis Data Streams, MSK, OpenSearch, DocumentDB |
Choosing a DMS target
Running and configuring tasks
AWS DMS tasks run on a replication instance that the customer sizes, or with DMS Serverless, which provisions and scales capacity automatically and suits variable or unknown workloads. A task can perform a full load, ongoing replication of changes (CDC), or both.
Table mappings select which schemas, tables and columns are migrated and can rename them, and transformation rules add or drop columns along the way. Data validation compares source and target rows to confirm that the migration is complete and correct. Large object (LOB) settings control how large text and binary values are copied, which has a significant effect on performance for tables that contain them.
DMS configuration
CDC prerequisites
Change data capture reads changes from the source database's transaction log, so the database must be configured to record enough detail in that log. Each engine has its own setting. MySQL needs binary logging in row format, so each changed row is recorded. Oracle needs supplemental logging, which adds the columns DMS needs to identify rows. SQL Server needs MS-CDC or MS-Replication, and PostgreSQL needs logical replication. The following table summarises the settings.
| Source | Must enable |
|---|---|
| MySQL | Binary logging in row format |
| Oracle | Supplemental logging |
| SQL Server | MS-CDC or MS-Replication |
| PostgreSQL | Logical replication |
Missing prerequisites are a common cause of CDC failures.
The following diagram shows a DMS pipeline that replicates an on-premises PostgreSQL orders table into the data lake, and the rows it writes to S3.

CDC prerequisites
Heterogeneous migrations and zero-ETL
When the source and target use different database engines, such as Oracle and Aurora PostgreSQL, the schema and code must be converted as well as the data. DMS Schema Conversion or the AWS Schema Conversion Tool converts tables, views and procedural code, reporting what needs manual work, and DMS then moves the data.
When the purpose is analytics in Amazon Redshift rather than migration, zero-ETL integrations from Aurora, RDS or DynamoDB replicate data continuously with no DMS tasks or pipeline to build, which is usually the answer when least operational overhead is required.
Conversion or zero-ETL?
Replicating an operational database into the lake
Analysts need the orders table from an on-premises PostgreSQL database in the S3 data lake, at most 15 minutes behind, without slowing the production database.
| Step | Configuration |
|---|---|
| Prerequisite | Enable logical replication on PostgreSQL so DMS can read the write-ahead log |
| Task type | Full load and CDC: copy existing rows, then stream changes |
| Target | S3 in Parquet, with a timestamp and an operation column (I, U, D) on each change |
| Downstream | A scheduled Glue job (or Iceberg MERGE) applies the changes to a current-state table |
| Monitoring | Alarms on CDCLatencySource and CDCLatencyTarget |
Reading the transaction log puts little load on the source, unlike repeated full extracts with SELECT *. If the source were Aurora and the target Redshift, a zero-ETL integration would do the same with no pipeline to manage at all.
How can you check that rows migrated by DMS match the source?
Show answer
With DMS data validation, which compares the source and target data.
Exam Tips
Remember for the exam
- To replicate ongoing database changes into the S3 data lake, use DMS full load plus CDC to S3, in Parquet.
- To stream database changes to Kinesis or Kafka, use DMS CDC with a Kinesis or MSK target.
- To check that migrated rows match the source, use DMS data validation.
- For Oracle to PostgreSQL, convert the schema with DMS Schema Conversion or SCT, then move the data with DMS.
- To run DMS without sizing replication instances, use DMS Serverless.
- If CDC fails to start, check the source's logging prerequisites, such as binlog or supplemental logging.