[SalesForce] Change Data Capture

With the new Change Data Capture tool coming out soon, why would someone use this over Platform Events? My understanding is that CDC utilizes Platform Events under the hood anyways.

Best Answer

CDC and Platform Events are really different use cases.

Platform Events are a generalized event-driven, publish/subscribe mechanism. You can publish Platform Events to represent record changes (in Apex triggers that you implement), but that's not all it can do, and that use case isn't provided as out-of-the-box Platform Events functionality.

You can also, for example, use Platform Events to implement logging on incoming requests to your Apex REST services, or any one of a hundred other use cases.

CDC is something a little different, although it has in common with Platform Events that it's event-driven. It's closer, I think, to being a generalized and deepened replacement for certain use cases of the Streaming API. It's more or less narrowly targeted at specific data replication and synchronization use cases:

Receive near-real-time changes of Salesforce records, and synchronize corresponding records in an external data store.

CDC, Platform Events, and the Streaming API all use the same CometD subscription protocol, so they do have a technical underpinning in common.

Related Topic