Heroku: My Dyno experience

Posté le

Auteur
David Matterne

David Matterne

Catégories

What is Heroku?

This was the question I asked myself when I started at 4C. Heroku is a cloud platform service, also known as a PaaS or Platform as a Service. In short, this means that it is a framework that makes it easier for developers such as myself to develop, deploy and test our applications. Developers manage the application, while Heroku manages the servers, the OS, the PaaS Software, etc. You can find more information on https://www.heroku.com/what.

Heroku1

Figure 1 Heroku Website Homepage

Before I started to work with Heroku, I heard a lot of positive things about it. I was told it is simple, easy to use and it supports different languages such as Java, Node JS, Ruby, Python, etc. People were extremely positive about it so my first step was to get more information and to get some hands-on experience.

My First Experience with Heroku

Getting Started

Since I had no previous experience with Heroku or other PaaS, I started by looking up information on the topic. This brought me to the Heroku Dev Center and the Salesforce Trailheads. These have a lot of useful information and have step by step guides on how to deploy an application to Heroku. I followed the steps and quickly succeeded! I was quite surprised at the ease of getting these applications up and running on the web. The web applications I had put on Heroku were already accessible to other people.

Heroku2

Figure 2 Getting Started Guides

The next step was to create my own Java Spring Boot application and deploy it. The goal was to retrieve data from Salesforce, and to display that data on Heroku. I managed to deploy it but my application was not yet running. For my application to run, I needed to activate it using a Dyno.

Dyno’s

There are 3 Types of Dyno’s.

  1. A web-dyno to run your web application
  2. A worker-dyno to run a background process
  3. A one-off dyno to run one-off administrative / maintenance / scheduled tasks

After implementing the web dyno, my Java web application was up and running successfully but I still needed to retrieve data from Salesforce and store it in the application’s database. For this I could utilize Heroku’s available add-ons.

Add-Ons

Heroku provides a lot of add-ons that can be linked to your Heroku Project. The ones I have used the most up to this point are:

More add-ons are available on: https://elements.heroku.com/addons.

Heroku3

Figure 3 Working Website with Heroku Connect

Add-ons add more functionality to your application. By simply adding the Heroku Postgres or a mLab Mongo DB add-on to your application, you create a database that you can easily connect to in your application.

The Heroku connect add-on is a powerful add-on that allows you to synchronize data between Salesforce and your own application. For example, another application that I created retrieved data from Salesforce, processed that data and generated a log file in the Amazon S3 Cloud storage. This was done by using both the Heroku Connect and Heroku Postgres add-ons.

Setting up Heroku Connect is very straightforward, you just specify which object and which object fields should be exported, and the data is automatically synced to your Heroku Postgres database:

Heroku4

Figure 4 Heroku Connect Mapping Screen

Conclusion

After using Heroku the last few months in several projects, using not only Java Spring Boot but also Node, Angular 2 and PHP I can only agree with the people who told me how great and easy to use Heroku is. If you want to give it a try, just head over to https://devcenter.heroku.com/start and try to set it up yourself, you will surely notice the benefits of using Heroku.

Prêt à devenir une “customer company” ?