Limitations:
- Subject to stricter governor limits, including a 10-second default timeout.
- If the external system is slow, it blocks the user and can result in a poor user experience.
- Cannot perform DML (Data Manipulation Language) operations in the same transaction context to avoid mixed DML errors in certain scenarios.
Synchronous APEX Callout
Automatic publication when standard/custom object records are created, updated, deleted, or undeleted.
Change Data Capture (CDC)
Long-running operations where the response isn’t immediately needed by the user (e.g., sending data to an external data warehouse, provisioning a user in another system, or processing orders)
Asynchronous APEX Callout
Scenario: A sales agent needs to check a customer’s credit score in real time within an Opportunity record before finalizing a high-value deal. The credit check is provided by a third-party API.
External Service via OpenAPI
Enables subscribers to retrieve missed events within the retention period (72 hours for both high-volume Platform Events and CDC events) if a client disconnects or crashes.
ReplayId
Ideal for use cases requiring logic or data processing, and chaining async processes.
Platform Events
Manual publication via Apex, Flow, Process Builder, or APIs.
Platform Events
Real-time data synchronization/replication to external data stores.
Change Data Capture (CDC)
Contains only the custom fields you define for the event object.
Platform Events
Notifying a third-party system when a significant change occurs in Salesforce (e.g., a new Account is created, an Opportunity status changes to “Closed Won”) to initiate subsequent processes like contract generation or provisioning
Change Data Capture (CDC)
You can specify a ______ to resume the event stream from a specific point, ensuring reliable message delivery and processing order.
ReplayId
Broadcasting custom notifications for specific business events/actions.
Platform Events
Operations that require higher governor limits (e.g., up to 120 seconds timeout, 12MB heap size)
Asynchronous APEX Callout
Enabling immediate analysis of operational data, such as inventory levels or sales trends, by providing external analytics platforms with the latest data as soon as it changes
Change Data Capture (CDC)
An immediate response is required for the user to proceed (e.g., validating a discount code, fetching a live price, or rendering dynamic data on the screen)
Synchronous APEX Callout
Requires defining a custom event object and implementing logic to publish events.
Platform Events
Maintaining a historical, granular record of all patient or customer data changes in an external system to support regulatory requirements and provide an accurate audit trail.
Change Data Capture (CDC)
Callouts triggered from triggers, batch Apex, or any background process, which are required to be asynchronous if they involve a DML operation
Asynchronous APEX Callout
Supports both inbound and outbound integrations with flexible schemas.
Platform Events
Does not support:
- Two-Way Sync
- REST/JSON endpoints
- High volume/Scalability
- Multi-Consumer Architecture
Outbound Messaging
Low-code solution; just select the objects to track in Setup.
Change Data Capture (CDC)
Scenario: When a new User is created in Salesforce, they must automatically be provisioned in an external payroll system.
External Service via OpenAPI
Ensuring consistency of shared data (e.g., account information, product catalogs, order status) across multiple enterprise systems, such as an ERP (Enterprise Resource Planning) or a secondary CRM
Change Data Capture (CDC)
To integrate external REST APIs into low-code tools like Flow Builder or Apex without writing boilerplate code for connectivity, authentication, and schema parsing. It is particularly valuable for enabling “citizen developers” (admins) to build complex, multi-system business processes using drag-and-drop tools
External Service via OpenAPI