Our account managers create items in SF(sObjects, if that matters), which soon afterwards need to be used in our web app(Ruby on Rails with PostgreSQL).

The data sync should happen as soon as possible, ideally, while switching to a different browser tab the data should already be in the app database. But while the reaction time needs to be low, these cases are not frequent, randomly a few times a day. So I wonder what an appropriate export mechanism would be?

These are the options I was able to figure out with google:

  • There's Streaming API, but this requires maintaining a permanent connection, which stays unused most of the time.
  • Polling the REST API, this is slow and counts towards the API call limits, and again useless most of the time.
  • Outbound Messaging, which sounds good but is not available in our subscription plan.
  • Apex Triggers, not sure if they allow to make HTTP requests and if this wouldn't be a misuse of the feature. Also, requires knowledge/maintenance of Apex code.

Any other? Is my understanding correct?

  • "not available in our subscription plan" - What edition of Salesforce do you have? – Daniel Ballinger Dec 14 '17 at 19:47
  • @DanielBallinger We're using a Professional edition, while outbound messages is only available in the Enterprise, as I believe. – RocketR Dec 18 '17 at 12:18
  • 1
    You can't have custom Apex triggers in a professional edition org either. Any sort of API access will need to be negotiated with your AE as it isn't on by default. – Daniel Ballinger Dec 18 '17 at 22:12

Something you might want to consider is the new Change Data Capture functionality which is specifically designed for this scenario. It's not GA yet (currently targeting Spring '18 Pilot), but is worth keeping an eye on.

Video from Dreamforce 2017 - Change Data Capture: Data Synchronization in the Cloud. The video is worth watching as at around the 4 minute mark Jay covers the various options that are available to do this. E.g. The Replication API and Platform Events.

Historically I've used Outbound Messages for this type of scenario and it's been sufficient for my requirements. It does mean hosting a SOAP based web service to receive the callouts, but it provides sync operations to the external system rapidly and doesn't require polling Salesforce for changes.

I've also gone down the trigger path in other scenarios. In those cases you almost always need an intermediate queue sObject and a scheduled job and batch to process the sync of the records from that queue. While it is more work, it also works and gives you more flexibility over the API's called out to.

| improve this answer | |
  • Thanks for the helpful answer and the video! I can see that the outbound messages or CDC are just what we need. Unfortunately, the difference in price is not justifiable for us, so streaming seems to be the best option. – RocketR Dec 19 '17 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.