Let me explain these AWS DMS (Database Migration Service) settings that control how DDL (Data Definition Language) changes are handled during Change Data Capture (CDC) replication:
What it does: When set to true, this setting automatically drops (deletes) the corresponding table in your target database whenever a table is dropped in your source database.
Example scenario:
customer_legacy in your source database being replicated to your targetDROP TABLE customer_legacy; on the source databaseWhen to use: Enable this when you want your target database schema to stay in perfect sync with your source, including table removals.
What it does: When set to true, this setting automatically truncates (removes all data while keeping the table structure) the corresponding table in your target database whenever a table is truncated in your source database.
Example scenario:
transaction_history in your source database with millions of recordsTRUNCATE TABLE transaction_history; on the source to clear out old dataWhen to use: Enable this for scenarios where periodic data clearing is part of your operational process and you need the target to mirror these operations exactly.
What it does: When set to true, this setting propagates structure modifications (like adding, dropping, or modifying columns) from your source tables to the corresponding target tables.
Example scenarios:
customer_preference is added to the customers table in your source databaseWhen to use: Enable this for most production environments where you want schema changes to be automatically propagated, keeping your target database structurally consistent with your source.
To enable these settings in your AWS DMS task, include them in your task settings JSON configuration:
"ChangeProcessingDdlHandlingPolicy": {
"HandleSourceTableDropped": true,
"HandleSourceTableTruncated": true,
"HandleSourceTableAltered": true
}
1. Dependent Applications: If applications are dependent on the target database, be aware that schema changes will occur automatically and may affect those applications.
2. Limited Support: Not all DDL statements are supported for all database types. Check AWS DMS documentation for specific limitations for your source/target combination.
3. Testing: Always test these settings in a non-production environment first to understand exactly how they behave with your specific database engines.
4. Full Control: These settings give you fine-grained control over how schema changes propagate, allowing you to choose whether to synchronize drops, truncates, and alters independently.