9

I need to notify an external system component about changes in Salesforce data. I am confused by the fact that there exist two seemingly competing solutions in Salesforce for that. Both look very similar with some noteworthy differences:

PushTopics with Notification via Streaming API

  • Declare Data condition with Metadata
  • Relaxed limits and no costs involved
  • Only listen via CometD client. No triggers.

Change Data Capture as a type of Platform Event

  • Can't listen for selective data changes (yet)
  • Very restricted limits and high costs
  • Listen to via Apex Triggers

So what I am asking is:

  1. What is Salesforce.com plan regarding those concepts? Will Platform Events replace Streaming channels and will Change Data Capture replace PushTopics?
  2. How did you decide in such cases in the past? What did you use? And why?

2 Answers 2

10

There are a lot of considerations behind this and I'm not on the engineering teams that are behind these features so take my answer with a grain of salt.

The TL;DR is yes, Change Data Capture (CDC) will replace PushTopics just like Platform Events (PE) will replace Generic events. All four event types are part of the streaming APIs but there are two generations:

Streaming API generations

I summarized this in 2019 in this post: A Refresher on the Four Streaming APIs and a Monitoring Tool

We haven't announced plans to retire the first generation of events but all of the innovation our teams are working on are focused on the second generation.

On a related note, we are working on a new Event Bus and we started a pilot in August 2021 for the new Pub/Sub API which uses gRPC as a replacement of CometD. Stay tuned for more news on that front.

4
  • So this then probably is old, outdated or simply untrue i.sstatic.net/Epsjo.png? Commented Jan 27, 2022 at 18:47
  • Not so old since it mentions CDC but not aligned with our best practices. Out of curiosity, where is this coming from?
    – POZ
    Commented Jan 28, 2022 at 13:07
  • Google result bringing me to a page with "dumps" showing this as a free question. I know they are often false and cannot be trusted. Commented Jan 28, 2022 at 13:52
  • Another push in the direction of sunsetting first generation events is that the new gRPC-enabled Pub Sub API only supports the second generation events (Platform Events and CDC): developer.salesforce.com/docs/platform/pub-sub-api/overview
    – POZ
    Commented Nov 15, 2022 at 12:31
2

You should definitely read Event-Driven Architecture on the Architects site.

I quote:

High-volume platform events and Change Data Capture (CDC) are the preferred mechanisms for publishing record and field changes that need to be consumed by other systems. Salesforce will continue to support PushTopics and generic events within current functional capabilities, but does not plan to make further investments in this technology.

So, don't use Push Topics or generic events in new work. And, as POZ said, consider the event bus as something new to learn about.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .