aws dms for postgres updates not showing before image

86 Views Asked by At

I am working on POC to migrate from Debezium to AWS DMS for PostgreSQL. PostgreSQL as Source and Kafka as Destination (AWS MSK). In Debezium i used to see before and after image for updates, but in DMS for Updates, i see only after values in Data section for the same table.

I could not find any documentation on how to get before image. Is this expected behavior or do i need to update any settings to get before image.

I am using PostgresSQL 14.4 version, DMS Replication Instance engine Version 3.5.1 and AWS MSK 2.3.1

Any info would be appreciated

I went through DMS documentation for Postgres as Source and searched over internet to see if i can find any solution. but havent found much helpful info.

1

There are 1 best solutions below

1
Sumanth Kandepi On

In DMS, there is a concept called "Beforeimage", and that's possible only with target endpoints like kafka or kinesis.

Use transformation rule - "add-before-image-columns"

Example:

"rules": [
    {
        "rule-type": "transformation",
        "rule-id": "03282024",
        "rule-name": "03282024",
        "rule-target": "column",
        "object-locator": {
            "schema-name": "%",
            "table-name": "%"
        },
        "rule-action": "add-before-image-columns",
        "before-image-def": {
            "column-prefix": "BI_",
            "column-suffix": "",
            "column-filter": "pk-only"
        }
    }
  1. https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.SelectionTransformation.Transformations.html
  2. https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.BeforeImage.html