-1

We want this to be a 2 way sync. So we already have a custom webservices to make callouts. I want to explore some standard options. 1) Can platform events be used to update external systems if Accounts/Contacts in our org is created or updated. 2) Similarly can we subscribe to events from external systems to check when the related table (Account/Contact) is updated. 3) Can Salesforce connect be used here?

1

1 Answer 1

0

You've tossed out a number of options, but when it comes to integrations there are certain established patterns that one will want to follow. There are also a number of considerations that need to be taken into account that impact the reliability of an integration as well as the cost in terms of API usage. There's the issue of whether real time updates are needed vs whether these updates can be done on a scheduled basis throughout the day, nightly, weekly, etc. All of these impact the cost of the integration.

  1. Platform events can be used to "notify" an external an external system that an Account or Contact has been updated. Recognize that a platform event sends a push notification via the streaming API. There's no guarantee the subscriber will receive it and it won't provide the subscriber with what they might need to authenticate to get the updated record in the same way outbound messaging does. The latter also has a retry for more more reliability.

  2. Yes, you can subscribe to events from an external system. The same caveats apply.

  3. Salesforce Connect is a different kind of integration where you use OData2 or OData4 to connect two databases. OData2 is read-only on the part of the subscriber. OData4 is read-write, allowing the subscriber org to create, update and delete records in the external database. Salesforce Connect will perform these operations asynchronously and isn't scalable in that it won't support high data volumes. See Writable External Objects Considerations for Salesforce Connect—All Adapters in the Help and Writable External Objects in the Apex Docs for more.

EDIT

In response to comments:

Change Data Capture would work for your situation. It's a new feature as of Spring 19 and uses platform events for increased scalability. The updates would occur Asynchronously and be processed as time is available on the server. Remember that for EE Orgs the daily limit is 25,000 events. Above that you'll pay extra. See Change Data Capture Documentation for more.

Depending on the size of org and the volume of data you expect, peak loads, etc., there may be other options you'll also want to consider. Platform platform events would typically not be the recommended solution for this kind of integration.

5
  • I dont think we will be dealing with a huge volume of data. Can CDC be leveraged here? I know the basic infrastructure of platform events and CDC is the same, but I have read CDC is recommended for real-time data sync.
    – KLab
    Jul 29, 2019 at 9:43
  • Yes, Change Data Capture would work for your situation. It's a new feature as of Spring 19. The updates would occur Asynchronously and processed as time is available on the server. Remember that for EE Orgs the daily limit is 25,000 events. Above that you'll pay extra. See developer.salesforce.com/docs/… for more.
    – crmprogdev
    Jul 29, 2019 at 13:34
  • Thank you Cal!!
    – KLab
    Jul 29, 2019 at 14:30
  • Hi Cal, I have been doing some reading around this, Platform Events and CDC has pretty much the same concept and infrastructure right? I am not able to understand why CDC is preferred over PE. Can you help?
    – KLab
    Jul 30, 2019 at 10:25
  • With Platform Events you'd need to define all the events as custom events, plus create the triggers or flows. It also doesn't support the encryption or the kind of security that CDC does without a lot of hassle. In essence, you'd need to reinvent the wheel to do the same thing using PE compared to CDC.
    – crmprogdev
    Jul 31, 2019 at 19:24

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