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?
closed as too broad by glls, battery.cord, Vijay Ganji, Raul, Reshma Jul 31 at 8:44
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
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.
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.
Yes, you can subscribe to events from an external system. The same caveats apply.
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.
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.