Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Salesforce Developer
medium

What is Change Data Capture and how does it differ from Platform Events?

Change Data Capture (CDC) is Salesforce's built-in event stream of record-level changes on enabled objects. When a record is created, updated, undeleted, or deleted, an event is published describing what changed.

Setup: Setup -> Change Data Capture -> select objects to enable. CDC is opt-in per object.

Event format — each event includes:

  • The change type (CREATE / UPDATE / UNDELETE / DELETE).
  • The record's Id.
  • A list of changed fields with their new values.
  • Header metadata (timestamp, transaction Id, change origin user).

Consume from Apex:

apex trigger AccountChangeTrigger on AccountChangeEvent (after insert) { for (AccountChangeEvent ev : Trigger.new) { EventBus.ChangeEventHeader hdr = ev.ChangeEventHeader; System.debug(hdr.changeType + ' on ' + hdr.recordIds); // ev.Phone, ev.Industry — only fields that changed are populated } }

Differences from Platform Events:

  • Schema — Platform Events are user-defined; CDC events are auto-generated from the source object's schema (Salesforce determines fields).
  • Trigger — Platform Events are explicitly published from code/flow; CDC events fire automatically on every record change.
  • Retention — both 72 hours.
  • Use case — Platform Events for custom semantic signals ("OrderApproved"); CDC for "tell me when records change".

Common consumers:

  • External replication — middleware subscribes via Pub/Sub API and writes changes to Snowflake/BigQuery.
  • Real-time integrations — system-of-record sync.
  • Audit logging — comprehensive record-change logs for compliance.
  • Apex triggers reacting to changes — declaratively, even when the change came from a non-Apex source (Data Loader, integration, etc.).

Volume considerations: CDC events count against per-org event delivery limits. For high-volume orgs, enable CDC selectively on the objects you actually need to react to.

Why this answer works

Modern integration. The "auto-generated vs explicit" distinction and the volume awareness are senior signals.

Follow-ups to expect

Related dictionary terms