We worked with one of our clients on integration of Heroku with Salesforce. In this post, I will provide some valuable insights about Heroku and ways to manage to Heroku integration with Salesforce. Let us now understand the scenario that we have in various enterprises.
In any enterprise we come across various services, and these services are built by different programming languages. These may be also running on different platforms. There are instances on various systems such as an accounting system that runs on one platform and the Cloud Services are rendered through the Salesforce platform. Quite often these enterprise applications are deployed on Heroku and need to be integrated with Salesforce. Let us first find out “What is Heroku?”.
What is Heroku?
Heroku is a platform-as-a-service (PaaS) that is built on Cloud platform to enable enterprises to deploy, run, manage and scale applications that runs across enterprises. It supports many programming languages of the likes of Java, Ruby, Python and PHP as well as Node.js. It allows you to deploy any app that is written with any of the above programming languages. It can also be integrated with Salesforce, following various methods to do so.Heroku essentially has various integration methods.
When we decide to integrate Salesforce, there are many reasons to do so.
What are the Reasons to Integrate Heroku with Salesforce?
The reasons for Salesforce integration are:
- Data Replication
- Data Proxies
- Custom User Interfaces
- External Processes
Data Replication is all about copying or synchronization of data between Salesforce and any other application. One of the common use cases provide a low-latency interface and high throughput for a customer-facing application, one that is built on open-source technologies.
In Data Proxies, there is no copying of the data. It aggregates different data stores. There is no need to store the data but the information is fetched on-demand from an external system. An example to cite is to generate reports with an Inventory system when Salesforce is integrated with warehouse and fetch the required data.
Custom User Interfaces
Customer User Interfaces in Salesforce are built with technologies such as Lightning components and Visualforce. The interfaces when built with open source technologies of the likes of Node.js, PHP and Java can be successfully integrated with Salesforce UI or run with Salesforce data and run on Heroku.
It is possible to offload batch processing or workflow and trigger event handling by using external processes. This is all dependent on the amount of jobs to be done.
What are the Ways to Integrate Heroku with Salesforce?
The above figure explains integration of Salesforce with Heroku. Some of these integration methods are:
- Heroku Connect
- Salesforce Connect
- Web Services Callouts
- Salesforce REST APIs
Let us understand the above terms, one by one.
Heroku Connect offers a pure form of data integration – syncing only object and table data. It offers both data proxies and data replication for Salesforce. It comes as an add-on to synchronize data between Salesforce objects and Heroku Postgres database, one that is attached to the Heroku application. This is data replication. The Salesforce objects are determined which Postgres tables.It maps the object fields to the columns in the table. Moreover, there is a on-going monitoring by Heroku to ensure that the rows and objects are created as per requirements, and this depends on the direction of syncing.
Example to cite is multiple Salesforce orgs that sync with Heroku Postgres database. This performs periodic actions such as lookups for other services, invoice generation as well as analytics.
It is an App Cloud Integration service to empower Salesforce users to access and manage data in external apps, directly from Salesforce, irrespective of whether the app is on-premise or Cloud. It basically offers a framework to view, search and modify data that is stored outside the Salesforce org. It uses external objects for data proxy of external data into Salesforce, with no need to copy it into the database. These external objects are similar to custom objects, but they are used for mapping data outside the Salesforce org.
Example to cite is to provide a unified customer view, on any device for the employees, by integration of external sources into your apps.
Web Services Callouts
You can tightly integrate your Apex with an external service just by making a call to an external Webservice, with an Apex Callout. An HTTP request can also be sent to an Apex code. The Callouts are useful for external processes in Heroku. Other than writing the callouts in Apex, workflow messages can also be used. This enables the events on Salesforce to trigger a Heroku process.
Salesforce REST APIs
This is ideally used in scenarios when the client requires something more than data integration. Once the integration is all set to go, then the API enables the user to perform a number of actions on Salesforce. The REST API is offered by the Salesforce platform can be invoked from a Heroku application. The API provides the following:
- Session ID or OAuth 2.0 Authentication for query of object metadata
- Execute queries with SOQL/SOSL
- Interact with Approval Processes
- Create or Modify Records
The data is accessed through simple JSON-formatted HTTP requests. This addresses both types of integration, that of data proxies and custom Interfaces.
Example to cite is an order management application that runs on Heroku and needs to fetch customer information from Salesforce. Here a single integration user can fetch all the necessary information from Salesforce.
Next, we delve into “How to Use Heroku Connect for Integration?”.
How to Use Heroku Connect for Salesforce Integration?
We have already learnt that Heroku Connect works in conjunction with Heroku Postgres database. It helps in data replication and data proxies.
Data Replication takes place when Salesforce works in tandem with the above mentioned SQL database. Otherwise data is proxied from Postgres database into Salesforce. This happens with the Salesforce Connect.
The Data Replication with Heroku Connect is either one way or bidirectional in nature. With Data Replication between Heroku Postgres to Salesforce, it ought to be configured with low latency, though not in real-time.
First, we create an authorization of Salesforce org with Heroku Connect. Next, we go mapping the Salesforce Objects. Next, we speak about connecting Heroku Connect with Heroku Postgres, we also need to understand about dataclips.
What are Dataclips?
Heroku Connect uses Heroku Postgres, so all the database features are maintained in the replicated data. The dataclips offer an easy way to query the data or share the data – in the CSV format or through web.
Use case for Heroku Connect
A typical example is when a business-to-consumer app makes use of Salesforce data and even changes it. The use case is that of a product catalog to be accessible by a public website. Here Heroku Connect helps in data replication and makes the data available to this site. This site is usually built with open-source technologies such as PHP, Java or Node,js.
The interface with the Heroku Connect is just a standard SQL.
Heroku Connect Application Architecture
Some of the points worth remembering are:
- Salesforce owns the schema for Data Replication with Heroku Connect.
- Configure the Heroku Connect Mapping after objects are customized in Salesforce.
- Mapping is possible not only for multiple objects as well as the relationships between objects. Here custom objects are collated with standard objects. Only the Heroku app can write on this object.
If you want to gather further insights on “How to Integrate with Salesforce Connect?”, refer to our next blog on the same topic.
Heroku is a platform-as-a-service (PaaS) that is built on the Cloud platform to enable enterprises to deploy, run, manage and scale applications that run across enterprises.
It is possible to integrate Heroku with Salesforce and the reasons are data replication, data proxies, customer user interfaces and external processes. There are various ways to integrate Heroku with Salesforce – one of them is Heroku Connect.
Heroku Connect works in conjunction with Heroku Postgres database. It helps in data replication and data proxies. Data Replication takes place when Salesforce works in tandem with a SQL database. Heroku Connect mapping only works after configuration.
This Post Has 2 Comments
Good article and right to the point. I searched for so many blogs online but this blog on how to integrate Heroku with Salesforce is just amazing. helped me a lot.
Hey Austin, Thanks for your kind words. We’re glad you found our content informative and helpful, and we look forward to sharing more with you.
Keep reading 🙂