function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jon WilberJon Wilber 

Best Way to do Bidirectional Data Syncronization in Salesforce?

Hey all,

I am working on a web application for my work.  The business has decided on a roadmap to start porting functionality over from our application into Salesforce.  Here is what we are trying to accomplish:

1. We need users to interact with our web application from Salesforce.  Any changes made in Salesforce should be reflected in our application near real-time.
2. We need changes in our application to be reflected in Salesforce in near real-time.
3. In addition to just porting data between the two systems, we need to users to be able to perform actions from Salesforce that are currently built into our web application.

We have a few constraints:

1. The integration should be very fault-tolerant.  If our servers go down or Salesforce goes down, we need to be able to sync the two systems back to parity.
2. We need to be very efficient with our API requests.

So far, I have looked into the Streaming API as a way to pull in data from SF in near real-time.  I was thinking we could send updates from our application to Salesforce every 5 minutes or so using custom APEX endpoint.

Another option I looked into was building custom components that would call our API's and load the data in Salesforce via that route.

Any thoughts or ideas would be appreciated.
Cameron KaragitzCameron Karagitz
Hello! I'm not sure if you ever found a solution, but I highly recommend Salesforce Platform Events or Change Data Capture for this use case. A pub/sub model will give you a near real-time integration. You can subscribe to the Salesforce event through your external web app via the CometD library and you can publish an event back to Salesforce by calling their REST API and creating an event record. From there, you can write a Trigger on Salesforce's side to execute business logic on the event from your web app.

An alternative thought: Host your web application on Heroku and utilize Heroku Connect to sync the Postgres db between the systems.

If you go down this route, you are going to remove the cons that come with a Point to Point solution.
Carol LoudCarol Loud
The best way to achieve bidirectional data synchronization in Salesforce is to use specialized data integration tools like Skyvia (https://skyvia.com/connectors/salesforce). Skyvia offers real-time or scheduled sync options, allowing data changes in one system to be automatically reflected in the other. Its pre-built templates and no-code platform make it easier to set up and maintain bidirectional sync without extensive technical expertise.