Blog

Heroku - the perfect solution to manipulate and integrate Salesforce data effortlessly


This article is prepared by our Salesforce Developer Dmitry Mitkevich.

The Salesforce platform plays a pivotal role in managing customer data, sales, and marketing processes. But what if you need to extend its capabilities or integrate it with other systems and databases? That's where Heroku comes in, offering the perfect solution to manipulate and integrate Salesforce data effortlessly.

Understanding Heroku

Heroku is a cloud platform-as-a-service (PaaS) that enables developers to easily build, deploy, and manage applications. It provides a scalable and flexible environment for hosting web applications and services, making it a popular choice for startups and enterprises alike. What sets Heroku apart is its ability to simplify complex tasks like scaling, monitoring, and infrastructure management, allowing developers to focus on building great applications.

!Heroku Dev Center!

Heroku officially supports a broad range of languages and frameworks: Ruby, Python, Node.js, PHP, Go, Java, Scala, and Clojure. For each, a set of curated open source Heroku Buildpacks (we'll cover this later) were created and integrated into the platform.
Browse over 6000 Heroku Buildpacks available in the Elements Marketplace by clicking the link.
Also, it will be useful to familiarize yourself with Heroku limits by clicking the link!


The Need for Heroku with Salesforce

Salesforce is great at managing customer data, but real-world business scenarios often require more than what it offers out-of-the-box. Here are a few scenarios where Salesforce integration with Heroku becomes invaluable:

1. Custom Workflows and Business Logic

When your business requires custom workflows, complex business logic, or automation that goes beyond Salesforce's standard features, Heroku allows you to build and deploy custom applications to address these needs seamlessly.

2. Data Integration

In today's interconnected tech landscape, data needs to flow freely between different systems. Heroku Connect, a bi-directional data synchronization service, bridges the gap between Salesforce and Heroku Postgres, enabling you to integrate Salesforce data with other databases, applications, or microservices.

3. Scalable Web Applications

If your business needs a highly scalable web application to serve your customers, Heroku's platform allows you to easily develop and deploy web applications. You can leverage the power of Salesforce data alongside your application's custom logic.

4. Analytics and Reporting

For advanced analytics and reporting needs, Heroku's data processing capabilities, combined with Salesforce data, provide a robust solution. You can perform complex queries, generate reports, and gain deeper insights into your customer data.


Use Cases and Solutions

Now let's explore some common use cases for using Salesforce with Heroku and how to solve them:

Use Case 1: Real-time Inventory Management

Solution: Suppose you need to keep your Salesforce product catalog in sync with your inventory management system. With Heroku Connect, you can create a real-time integration between Salesforce and your inventory database. Any changes made to one system are instantly reflected in the other, ensuring accurate inventory data for sales departments.

Use Case 2: Custom Mobile App

Solution: If your sales team needs a custom mobile app to access customer information and create orders on the go, Heroku can help. Develop a mobile app, host a backend part of this app using Heroku and integrate it with Salesforce data via Heroku Connect. This empowers your team with real-time customer insights, improving productivity and customer service.

Use Case 3: Predictive Analytics

Solution: To leverage predictive analytics on your Salesforce data, use Heroku Postgres to store and process historical data efficiently. You can then build machine learning models or utilize third-party tools for predictive analysis to help make data-driven decisions and anticipate customer needs.

Use Case 4: Marketing Automation

Solution: Integrate Salesforce with Heroku to create a comprehensive marketing automation solution. Heroku can handle the custom logic for personalized marketing campaigns while Salesforce stores customer data. The two systems work in tandem, ensuring targeted and effective marketing efforts.


Integration Methods between Salesforce and Heroku

To connect Salesforce to Heroku, you have several integration methods at your disposal:

1. Heroku Connect

Heroku Connect provides seamless integration between Salesforce and Heroku Postgres databases. It allows you to map Salesforce objects to Heroku Postgres tables, enabling real-time data synchronization. Changes made in either Salesforce or Heroku Postgres are automatically reflected in both systems. Heroku Connect simplifies data integration, making it an ideal choice for scenarios where you need to keep Salesforce data in sync with a custom application running on Heroku.
!More Info by clicking the link!
2. RESTful APIs

Salesforce offers a robust set of RESTful APIs that allow you to interact with Salesforce data programmatically. Community libraries, such as nforce or JSForce for Node.js, can provide convenience wrappers for invoking the API. You can use these APIs to retrieve, create, update, or delete records in Salesforce from your Heroku application. This method provides flexibility and fine-grained control over data interactions between the two platforms.
!Here - more!
3. Salesforce Connect

You can use Salesforce Connect (formerly called Lightning Connect) as a data proxy to pull OData or other data sources into Salesforce on demand. All of this is done by reference: the data remains in Heroku Postgres, but it can be read from and, in most cases, written to from within Salesforce.
!Click the link to know more!
4. Platform Events

Salesforce Platform Events enable near-real-time communication between Salesforce and external systems, including Heroku. You can use Platform Events to trigger actions in Heroku applications when specific events occur in Salesforce. This is particularly useful for scenarios where you need to respond to changes in Salesforce data promptly.
!Don't forget to follow the link!
5. Callouts

Callouts provide a way for Salesforce to notify your Heroku application when specific events occur. You can configure Salesforce to send HTTP requests to your Heroku app when relevant events happen, such as new leads being created or opportunities closing. Heroku can then process these requests and take appropriate actions.
!Described in more detail here!


Security and Heroku/Salesforce Integrations

When using Heroku and Salesforce together, particularly in the calling the Salesforce REST API, Salesforce Platform Events and Apex HTTP callouts scenarios, security posture may be improved with an exclusive trust relationship, preventing undesired traffic from the public internet.

In particular, if your Heroku application runs in a Private Space, you can:

1. Ensure that the app is not available on the public internet, and only available from your Salesforce org (Salesforce → Heroku)

2. Ensure that your Salesforce org has appropriate IP restrictions to prevent public access, and prevent public OAuth endpoint access (Heroku → Salesforce)

Heroku Shield

Heroku Shield is a set of Heroku platform services that offer additional security features needed for building high compliance applications.

Heroku Shield is available to Heroku Enterprise customers as an additional package. Your Shield apps run in your own network isolated Heroku Shield Private Space using Heroku Shield Private Dynos to further enhance security at runtime.

You have the option to add Heroku Shield Postgres for highly-compliant data management and Heroku Shield Connect to safely sync data between your Shield apps and Salesforce.


Heroku under the hood

Dynos – lightweight, container-like units of computing power in Heroku's cloud infrastructure. They are responsible for running your web application and executing various processes, such as handling web requests, running background jobs, or performing scheduled tasks.

Slugs – Heroku's packaging format for applications. A slug is essentially a compressed and pre-built version of your application, including your code, dependencies, and a runtime environment.

Buildpacks – responsible for transforming your application's source code into a runnable slug. Heroku supports various buildpacks for different programming languages and frameworks.

Heroku Router – component of Heroku responsible for routing incoming HTTP requests to the appropriate dynos that are running your application.

Add-ons – third-party services and resources that you can easily integrate with your Heroku application to add functionality or enhance your app's capabilities.

In summary, Heroku's platform consists of dynos for running your application, slugs and buildpacks for packaging and deploying your code, the Heroku Router for routing incoming requests, and add-ons for extending your application's functionality with third-party services. Together, these components make Heroku a popular choice for deploying web applications quickly and easily.


Conclusion

By combining the strengths of Salesforce and Heroku and selecting the appropriate integration method, you can unlock the full potential of your customer data, streamline business processes, and gain a competitive advantage in today's data-driven world. So, if you're looking to manipulate and integrate Salesforce data, consider Heroku as your trusted partner on this transformation journey. Connecting Salesforce to Heroku is the first step towards achieving these goals, enabling you to harness the true power of your data.