As part of integration in AppExchange, we would like to capture Salesforce record changes in external system when some change happens in Salesforce records.
There are multiple ways to inform external system from Salesforce as below:
1. Change Data Capture
- Change data capture fits best where we want to monitor the crated/updated contacts within Salesforce.
- But change data has some default allocations as mentioned in below URL: https://developer.salesforce.com/docs/atlas.en-us.change_data_capture.meta/change_data_capture/cdc_allocations.htm
- If we use it as part of AppExchange app, it may be possible that we will be consuming their default allocation limit. e.g. (5 CDC objects, if AppExchange consumes 5 CDC objects there will be nothing left for the existing org).
2. Push Topics
- Push Topics is another way to receive notifications for change in the external system.
- We can capture changes of Create, Read, Update, delete and Field changes.
- Again, Push Topics has some allocations (e.g. 100 PushTopics records, Maximum delivered events, etc.) as mentioned in below URL: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/limits.htm
3. Platform Events
- We can generate a trigger/Process builder through which we can publish an event in the Platform Event, with change record ID and changed record sObjectType. By this we can use a single Platform Event to track all object 's changes.
- Platform Events also has their own limit (e.g. 50,000 events) in default alloctaion. https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_event_limits.htm
4. Future method/Batch Apex combination of Apex
- Another way can be to have a future method that will fire from trigger and notify external system. Maximum number of future methods are 250,000 or the number of user licenses multiplied by 200, whichever is greater. This limit is for your entire org and is shared with all asynchronous Apex: Batch Apex, Queueable Apex, scheduled Apex, and future methods.
Question: Considering multiple customer org with below consideration, is there any recommended way to capture the record changes in the Salesforce AppExchange apps? Or as a Product the App should support all ways of sync and let customer 's admin took the decision of what feature they want to use to capture the changes?
- Different Salesforce editions (Enterprise, Unlimited, Professional, etc.)
- Existing implementation that may be using CDC, Push Topics, Platform Event or Batch Apex
- Daily bulk import in some of the customers orgs from external system
- Dependency of feature (Push Topic, CDC, Platform Event) in customer org.