Developers

Salesforce Summaries – A Developer’s Guide to Heroku Connect

By Andy Hitchings

SalesforceSummaries: a series delivering key insights from Salesforce YouTube videos, to save you time as you keep up to date with the latest technological changes within the Salesforce ecosystem. 

Introduction:

Heroku makes the scaling of cloud computing resources much easier and efficient, with the concept of ‘dynos’. However, Heroku also offers a service to connect to Salesforce very efficiently. Leveraging this with Salesforce Canvas results in compelling applications. In addition to this summary, the links here and here will also help you to understand more about the power of leveraging Heroku with Salesforce.

Details:A Developer’s Guide to Heroku Connect

Presenter: William Gradin

Details: 20 minutes

Key Terms: Heroku, Heroku Connect, Salesforce Canvas, Business Intelligence, Tableau

1.@0.35 — Force.com is a great platform to build apps that extend business processes. If you need an app that requires all the security and granular controls, then Force.com is a fantastic platform to build the app on. Force.com is especially great for employee facing apps.

2.@1.05 — Heroku is a platform to develop customer apps on. You can build apps using a large set of programming languages as Heroku is language agnostic. You can scale cloud computing resources easily to match your demand.

3.@1.35 — Lyft (the ridesharing app) is built on the Heroku platform.

4.@2.20 — The best customer apps connect two critical elements: customer engagement and business process. You can leverage Heroku for customer engagement and Force.com for business processes.

5.@3.00 — To achieve this, you can leverage Heroku Connect. Heroku Connect is the data synchronisation engine between Heroku and Salesforce and shuttles data back and forth and syncs it between these 2 platforms.

In the use case of Lyft, new drivers would use the app that has been deployed to Heroku to sign up to Lyft. Then, this data is synced with the corresponding Salesforce org and that’s where apps and functionality in this org (Force.com platform) can be leveraged. For example, an approval process is initiated whenever a new driver signs up.

6.@4.05 — As per the code here, the following node.js app with Angular front end has been deployed to Heroku which simply displays the contact list from a Salesforce developer org. The syncing is bi-directional and so if one edits a contact record on the node.js app, then that is displayed in Salesforce and vice-versa.

7.@5.15 — The screenshot below shows the Heroku Connect product. OAuth has been used to authenticate into Force.com so that Heroku Connect can talk to the Force.com APIs. And Heroku Connect has also been connected to the Postgres database that sits underneath the Heroku application.

8.@5.45 — By selecting the ‘Add’ button, all of the Salesforce sObjects will be displayed.

9.@6.50 — In this example, the Contact sObject has been queried and then the following screen is displayed with all of the Contact fields.

10.@7.05 — For the purposes of the demo, just a few fields from the Contact sObject has been selected. On the next screen, the access mode displays:

This is where you can specify the sync’ing direction (either bi-directional or just one way).

The Heroku spinner icon is going; which indicates that Heroku Connect is connecting to Force.com and pulling down all of the Contact records into the Postgres database.

11.@8.05 — Leveraging the command line, one can see the table has been created in Heroku and using SQL, you can query the data in this table.

12.@8.15 — Leveraging the Heroku dashboard, one can see the number of records in the database.

13.@8.30 — The node.js app is returning the contact data from the Heroku database. The response is in JSON format, which is then returned to the client.

14.@9.15 — Because the sync has been to set bi-directionally, one can update a contact record in the node.js app and this will consequently update the Heroku database and therefore, via Heroku Connect, update the record in Salesforce. The code for the contact update from the node.js app is:

15.@11.05 — Heroku Connect is built on a synchronization engine. It is running 24/7, sync’ing data back and forth between Heroku and Force.com. Heroku Connect is able to leverage the Salesforce streaming, SOAP and bulk API. Heroku Connect is, in effect, giving you an alternative API into the Force.com platform. And that API is just SQL because Heroku Connect hides all the complexities of dealing with the Force.com system.

16.@11.40 — This other presentation will walkthrough how Tableau leverages Heroku Connect.

17.@12.10 — The vision from Tableau is to help people to see and understand their data. Tableau was created in 2003 and is the fastest growing BI (business intelligence) company.

18.@12.30 — A big question that Tableau asked was ‘how can we provide users the power of Tableau and embed it within Salesforce?’.

19.@13.05 — The technologies that are used to achieve this are:

20.@13.50 — Here is an architecture diagram to show the data flow between the different systems.

The Salesforce Canvas connector establishes the trusted relationship between Tableau and Salesforce. This is where communication between the two systems takes place over HTTPS. SAML can be leveraged with this process too, so that you can use Single Sign On.

21.@15.00 — The Salesforce data is posted to the Heroku postgres database via Heroku Connect. Tableau establishes a live connection with Heroku and the end result is that near real-time data visualisations are displayed in Salesforce via Canvas.

22.@17.30 — As per the demo, the results are compelling:

Tableau rendering inside Salesforce Canvas with near real-time data via Heroku Connect

The Author

Andy Hitchings

Andy is a certified Salesforce and DocuSign admin and a certified Salesforce developer. His favorite technologies right now are the Force.com platform and Javascript.

Leave a Reply