Skip to content

TiCDC Avro Protocol Supports "Before" State #12631

@ginkgoch

Description

@ginkgoch

Is your feature request related to a problem?

The current protocol=avro in TiCDC is highly efficient but only provides the After state of a row. While Data Engineering teams are satisfied, Backend Services require the Before state for auditing, stateful logic, and cache invalidation. Users currently have to choose between efficiency (Avro) and data richness (Debezium JSON/Canal JSON).

Describe the feature you'd like

When using avro format to kafka, add a query parameter like include-before-value, when it is true, an extension field _ticdc_before is added to the message. Like:

{
  // --- Existing Root Level (The "After" state) ---
  "id": 1001,
  "name": "Howard",
  "age": 20,

  // --- New Optional Metadata Field ---
  "_ticdc_before": {
     "id": 1001,
     "name": "Howard",
     "age": 18
  },

  // --- Existing Metadata ---
  "_ticdc_op": "u",
  "_ticdc_commit_ts": 442318927364526081
}

Describe alternatives you've considered

No response

Teachability, Documentation, Adoption, Migration Strategy

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributionThis PR is from a community contributor.type/featureIssues about a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions