Loading

Data Replication Using Change Event Streams or Replication API

Publiceringsdatum: May 3, 2026
Beskrivning

With data replication, you can store and maintain an external, separate copy of your organization’s pertinent Salesforce data for specialized uses, such as data warehousing, data mining, custom reporting, analytics, and integration with other applications. Data replication provides you with local control and the ability to run large or ad hoc analytical queries across the entire data set without transmitting all that data across the network. 

To keep your external data store up-to-date with Salesforce, use Change Data Capture to get real-time notifications of Salesforce record changes. By subscribing to a Change Data Capture channel, you receive a stream of change event messages for record changes, including insertion, update, deletion, and un deletion. With Change Data Capture, you get broad access to data and can perform updates in your target store using transaction boundaries. Change Data Capture provides a versioned event schema and retains change events temporarily for later retrieval. For more information, see the Change Data Capture Basics Trailhead module , or for a complete reference, see the Change Data Capture Developer Guide.

Alternatively, use the Replication API for data replication. The Replication API is not real-time and requires that you make repeated API calls to poll for changes over time. It includes two calls, getUpdated and getDeleted. The getUpdated call returns the IDs of newly created and updated records. The getDeleted call returns the IDs of records that have been deleted. 

Lösning

How to Choose a Data Replication Approach
You can replicate Salesforce data to an external system using two main approaches: Change Data Capture (CDC) for real-time streaming, or the Replication API for polling-based replication. The approach you choose depends on your latency requirements and whether your external system supports event-driven architecture.
Using Change Data Capture
Subscribe to a Change Data Capture channel to receive real-time notifications of Salesforce record changes, including insertions, updates, deletions, and undeletions. Change Data Capture provides a versioned event schema and retains events temporarily for later retrieval, making it suitable for near-real-time integration scenarios. For more information, see the Change Data Capture Basics Trailhead module or the Change Data Capture Developer Guide.
Using the Replication API
The Replication API is not real-time and requires repeated API calls to poll for changes over time. It includes two calls: getUpdated (returns IDs of newly created and updated records) and getDeleted (returns IDs of deleted records). Once you have a list of ID values, use retrieve to export data in batches of up to 2,000 records. The Replication API ensures you cannot miss records and will not retrieve duplicates — an advantage over querying directly based on CreatedDate or LastModifiedDate fields (which may miss in-flight transactions).

Knowledge-artikelnummer

000386267

 
Laddar
Salesforce Help | Article