NexBlazers Logo
NexBlazers Learn • Build • Grow
Architecture & Apex

Platform Events vs CDC vs PushTopics vs Pub/Sub API: Choosing Your Salesforce Event Channel

Written by NexBlazers Architecture Team November 19, 2026 18 min read Interactive

"Just use a platform event." "No, use CDC." "Our middleware already listens to a PushTopic." "Shouldn't this be Pub/Sub API?" Every Salesforce integration design meeting gets here eventually. The confusion is real, because these four names aren't four versions of the same thing.

Three of them are kinds of event, meaning what gets published. Pub/Sub API is a way to connect, meaning how an external system publishes and subscribes. Once that clicks, the choice gets much easier. In this post you'll fire real-world scenarios at all four in the Event Bus Simulator, inspect each one's payload, build your own recommendation in the Channel Picker, and finish with an interview-style quiz.

What is published (event types)
Platform Events Change Data Capture PushTopics (legacy)
How external apps connect (transports)
Pub/Sub API (gRPC) Streaming API (CometD)
Try it

The Event Bus Simulator

Pick something that happens in your org, then press Fire. Watch which channel delivers, which stays silent, and why.

What happens?
Event bus log (simplified)
// pick a scenario and press Fire

1. The one-minute mental model

What it isWho publishesStatus
Platform EventsCustom messages with a schema you define (Order_Shipped__e)You: Apex, Flow, or an APICurrent
Change Data CaptureAutomatic messages for record create, update, delete and undeleteSalesforce, on commitCurrent
PushTopicsNotifications for records matching a SOQL querySalesforce, when a match changesLegacy
Pub/Sub APIgRPC API to publish and subscribe to platform events and change eventsn/a (it's the pipe)Recommended

Salesforce is explicit on two points. PushTopic and generic events are legacy products. And for new apps that publish or subscribe to platform events and change events, it recommends Pub/Sub API instead of the CometD-based Streaming API.

2. Platform Events: messages you design

You define a platform event much like a custom object, with an __e suffix and typed fields. Publish it from Apex, Flow or an external API. Subscribe with Apex triggers, platform event–triggered flows, the empApi Lightning component, CometD or Pub/Sub API. Use them for business moments that no single record change captures: "order shipped", "payment failed", "printer low on ink".

// Publish (Apex)
List<Order_Shipped__e> events = new List<Order_Shipped__e>();
events.add(new Order_Shipped__e(Order_Number__c = 'ORD-1042', Carrier__c = 'DHL'));
List<Database.SaveResult> results = EventBus.publish(events); // never throws: check each result

// Subscribe (Apex): platform event triggers are always after insert
trigger OrderShippedSubscriber on Order_Shipped__e (after insert) {
  List<Task> tasks = new List<Task>();
  for (Order_Shipped__e evt : Trigger.new) {
    tasks.add(new Task(Subject = 'Notify customer: ' + evt.Order_Number__c));
  }
  insert tasks;
}
  • Publish behavior matters. Publish After Commit waits for the transaction to succeed and rolls back with it. Publish Immediately doesn't respect transaction boundaries, which is what you want for error logging that must survive a rollback. Publish behavior doesn't apply to Pub/Sub API publishing.
  • Triggers run on their own. Event triggers run asynchronously in a separate transaction, as the Automated Process user by default, with batches of up to 2,000 messages. Override the user and batch size with PlatformEventSubscriberConfig.
  • Deduplicate with EventUuid. To identify a message uniquely, use the EventUuid field, not ReplayId.
  • Release note: new event definitions have been high-volume since API version 45.0. Standard-volume custom platform events are scheduled to retire in Summer '27, so migrate any you still have.
Look inside

Payload Inspector

The same kind of business change, as each channel delivers it. Tap the highlighted fields to see why they matter.


                        

Samples are trimmed for readability. IDs and values are illustrative.

3. Change Data Capture: the record's diary

Select objects on the Change Data Capture page in Setup, and Salesforce publishes a change event whenever a record is created, updated, deleted or undeleted. You write no publishing code. CDC is built for keeping another system in sync. Every event carries a ChangeEventHeader with changeType, changedFields, changeOrigin, and the transactionKey and sequenceNumber you need to replay a whole transaction as one commit downstream.

  • Five objects by default. Without an add-on licence you can select up to five entities, counted across all channels.
  • Handle gap and overflow events. When Salesforce can't generate a full change event (for example, a change made directly in the database, or an event over 1 MB), it sends a gap event with only the header. Your subscriber should re-read the record by ID.
  • Loop protection. changeOrigin shows which API and client made the change, so your integration can skip changes it made itself.
  • Apex can listen too. Change event triggers (AccountChangeEvent, Employee__ChangeEvent) are after-insert only and run asynchronously after the change commits. Flows can't subscribe to change events.

4. PushTopics: the original, now legacy

A PushTopic is a SOQL query saved as a channel (/topic/InvoiceStatementUpdates). When a matching record changes, subscribers get a notification. Salesforce no longer adds features to PushTopic events, gives them limited support, and recommends CDC instead. Two gaps catch teams out:

  • Bulk API changes are invisible. Changes made through Bulk API, including Data Loader and the Mass Transfer tool, don't generate notifications.
  • Cascade deletes are invisible. Records deleted because their parent was deleted don't trigger a notification. CDC does capture them.

PushTopic events are kept for 24 hours (high-volume platform events and change events for 72), and you can only subscribe to them through CometD, not Pub/Sub API.

5. Pub/Sub API: the modern pipe

Pub/Sub API is a single gRPC API, over HTTP/2, to publish events, subscribe to them and fetch their schemas. Payloads are compact binary Apache Avro. It went GA in 2022 and works with any of the 11 languages gRPC officially supports.

  • Pull-based flow control. The client asks for N events and asks for more when it's ready, so a slow consumer isn't flooded. Compare that with CometD pushing as fast as events arrive.
  • Managed subscriptions (beta). With ManagedSubscribe, the client commits the last processed Replay ID to Salesforce, and a restarted client resumes from there. You no longer have to store Replay IDs yourself.
  • What it can't do. It doesn't carry PushTopic or generic events. Moving to Pub/Sub API means moving to platform events or CDC.
  • On AWS? Event Relay streams platform events and change events to Amazon EventBridge with no subscriber app to run.
Architecture Note: the allocation everyone forgets External subscribers (Pub/Sub API, CometD, empApi, event relays) share one rolling 24-hour event delivery allocation across platform events and change events: 50,000 in Performance and Unlimited, 25,000 in Enterprise and 10,000 in Developer Edition, without an add-on. It's counted per subscribed client, so two subscribers each receiving 15,000 events use 30,000. Apex triggers and flows don't count against it. Size it before go-live, not after the first disconnect.
Decision helper

The Channel Picker

Answer five questions about your integration. Get the event type, how to consume it, and the settings that matter.

Question 1 of 5
Interview-ready

Predict the Outcome

Six scenarios that come up in integration reviews and interviews.

Question 1 of 6 Score: 0

Cheat sheet: side by side

Platform EventsCDCPushTopics
Triggered byYour code, Flow or APIRecord create/update/delete/undeleteRecord matching a SOQL query
PayloadFields you defineHeader + changed record fieldsFields in the query
Retention72 hours72 hours24 hours
Apex triggerYes (after insert)Yes (after insert)No
FlowPublish and subscribeNoNo
Pub/Sub APIPublish and subscribeSubscribeNo (CometD only)
Bulk API changesn/aCapturedNot captured
Best forBusiness events, decoupling, inbound signalsReplicating data to other systemsExisting apps only; plan a migration

Checked against the Platform Events, Change Data Capture, Streaming API and Pub/Sub API developer guides in November 2026. Allocations vary by edition and add-on, so confirm yours in Setup.

Keep learning

Official Resources

Straight from Salesforce: the docs this article is based on.

Designing an event-driven integration, or retiring PushTopics?

Book a session with our architects to choose channels, size allocations and plan the migration.

Book Architecture Review