ProgrammingJavascriptCareerProductivityGadgetsASP.NETWeb Design

Getting to know Heroku in 5 minutes

Written by
Published on
Filed under
Getting to know Heroku in 5 minutes

What is Heroku?

Heroku is a cloud application platform that first launched in 2007 with a single programming language in mind, Ruby. In 2010 Heroku was acquired by Salesforce and shortly after began to support Node.js and Clojure as well.

In 2011, Yukihiro Matsumoto (Matz), the chief designer of the Ruby programming language, joined the company as Chief Architect. Needless to say, Heroku has a strong technical lineage.

So what is Heroku, exactly? Heroku allows developers and large organizations to deploy, manage and scale web applications on the cloud in isolated and virtualized containers that scale rapidly. There's alot of technical jargon there. But essentially, Heroku allows developers to create virtual platforms from which they can run their web apps.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps to the world. The platform handles much of the low-level work for you.

And there's alot to like here, so let's go further into the details of it all.

Supported languages

Initially, Heroku was designed to work solely with the Ruby Programming language. Shortly after it's acquisition by Salesforce, the platform grew to support applications running under Node.js and Clojure.

Heroku currently supports some of the most widely used and popular programming languages used by modern developers, such as:

- Node.js
- Ruby
- Java
- PHP
- Python
- Go
- Scala
- Clojure

If you're a .NET developer, you are out of luck as there is no official current support for .NET languages such as C# or F#. This mainly has to do with the fact that Heroku relies on Unix based containers in order to host applications (dynos). Since web applications running under the .NET Framework require a Windows environment (not .NET Core), these applications would not be compatible.

However, Heroku does provide custom buildpacks meaning developers can deploy their applications using a variety of other non-official languages.

Take note that 3rd party buildpacks are not maintained or supported by Heroku, so take caution when implementing them, if you are to do so.

Front-end frameworks, such as React, Vue.js and Angular, currently lead in terms of popularity growth, meaning that Heroku is an ideal platform for these applications to be hosted on.

Pricing

If you're a student developer, or a freelancer, or simply someone that doesn't want to break the bank hosting your 3 page blog, then pricing is super important when choosing a hosting platform. Heroku offers various pricing options to accommodate most individuals or organizations, ranging from a zero cost tier, all the way up to high-performance multi-dyno setups.

In general, cloud hosting environments will almost always be more expensive than the traditional shared hosting providers, like GoDaddy. With increased costs however, you also get increased benefits, such as scalability, decreased downtime and continuous delivery.

Most cloud hosting platforms typically offer some form of a free-tier for users just getting started. And Heroku is no different.

There are 4 different primary tiers when it comes to selecting a Heroku plan. Though it's important to note that each of those plans have sub-tiers as well. The Production tier for example is split into 2 separate plans, Standard 1X and Standard 2X. Essentially increasing the amount of RAM available.

Free and hobby

This is the best place to start with your apps. Note that Free and Hobby are not the same thing. The Free option offers you 550-1000 dyno hours every month and 2 process types. This plan however does not include free SSL.

The Hobby tier has a cost associated with it per dyno, keeping the RAM at 512MB, but bumps up the process types to 10 instead of 2. You also get free SSL with this option.

Production / Standard

The Production plan is ideal once you have your MVP deployed and your bugs worked out. This includes all the features in the Hobby plan but now you have the option of either a 512MB dyno or 1GB. Both options also include unlimited process types as well.

Advanced / Performance

The Advanced tier is best suited for business applications. This tier comes in 2 types, Performance M and Performance L, with the M tier 2.5GB of RAM and the L tier bumping that up to 14GB of RAM.

The Performance plans also feature autoscaling, ensuring increased resources when demand goes up unexpectedly.

Enterprise / Private

This is the highest tier that you can possibly get with Heroku and is best suited for heavy duty applications typically only found in large scale organizations. I won't go into too much detail with this tier as I have not had much experience in this department, but here are a few of the features included.

- Full network isolation
- Available in six global regions
- Dedicated runtime environment
- Private network and data services
- S, M, and L dyno types available

Coming from a background in shared hosting physical servers, where the options are incredibly limited, it is refreshing to see the flexibility that Heroku offers.

Dyno's

Dyno's are at the heart of Heroku applications.

Heroku applications are run in virtual containers which execute on the Heroku runtime. These containers are referred to as dynos.

In more technical terms, a dyno is a virtualized Unix container that runs isolated from other dynos and that provides the environment needed for an application to run on.

Each of the dynos are spread across a dyno grid.

The biggest benefit of this isolated container architecture is that applications can be scaled up or down seamlessly by either adding/removing dynos or by increasing the resources on any given dyno.

The dyno manager is what keeps dynos running automatically on a given region typically maintenance free.

Scaling horizontally

Heroku makes it super simple to add more dynos of a given type (web dynos, worker dynos) to your application.

This is typically referred to as horizontal scaling and can be beneficial for a number of reasons, such as handling more HTTP requests concurrently.

Note that scaling is not available in the Free or Hobby tiers (mentioned above).

Scaling vertically

Vertical scaling refers to the process of upgrading your current dynos to more powerful ones, by increasing resources such as RAM.

This means more memory and CPU resources available to your applications when needed.

Vertical scaling makes perfect sense when running high resource jobs that could potentially eat up too much memory causing issues in other parts of an application.

Autoscaling

Heroku also offers the option of autoscaling, making sure that your apps automatically increase the number of web dynos needed to maintain a certain level of performance.

Heroku autoscaling uses your apps 95th percentile response time to manage the need for autoscaling.

That level of performance is referred to as p95. p95 represents the response time in milliseconds that only 5% of your app's response times exceeds.

Note that autoscaling is currently available in the Performance and Private web dynos at no extra cost.

Heroku Pipelines

In Heroku speak, a pipeline is a group of Heroku apps that share the same codebase. Each of the apps represents one of the stages in a continuous delivery workflow.

Those stages would include:

- Development
- Review
- Staging
- Production

The development phase typically happens when the programmer makes a pull request. This causes Heroku to automatically create a Review app.

When code changes are ready, they are merged with the master branch which automatically gets deployed to the Staging app for testing.

When all tests pass and the app changes are ready for production, the developer can promote the Staging app to Production.

The power here is that developers can manage their own pipelines that are better suited for their development environments and teams.

Heroku and databases

When it first launched, Heroku only had support for Redis databases. That has not changed since 2007. Heroku has since added support for PostgreSQL however, dubbed Heroku Postgres.

Heroku Postgres is the cloud database service providing features such as continuous protection, rollback and high availability.

All plans feature automatic health checks, off-premises storage, daily backups, SSL-protected access, dataclips, Postgres extensions, and a web Ul.

Heroku Postgres delivers the open source database as a trusted, secure, and scalable service that is optimized for developers.

Add-ons

Heroku offers an extensive list of components and services that add functionality to your web applications and that are fully maintained by either Heroku or by a third-party.

A few examples of these services include the following:

Bucketeer - Use Amazon S3 in your Heroku application
Treasure Data - Analytics platform on Heroku
Heroku Postgres - Reliable database as a service based on PostgresSQL
MSSQL - The Microsoft SQL database for your Heroku application

And many many more. The full list of available addons can be found at the following url.

Add-ons can be managed through either the Heroku Dashboard or through the command-line interface.

One last note. Not all Heroku Add-ons are free to install and use. Some offer advanced features typically not found for free anywhere online. As such, these may come with a subscription cost. Though many of these also offer some form of free or starter tier.

Buttons

Heroku Buttons are one-click configure and install apps that you can deploy to your dynos.

Why is it called Buttons? Well, because it's essentially a single-button install.

Heroku Buttons essentially point to source code repositories with configuration files that can be changed to determine how the application is deployed.

Once you click on the button, you are taken to a deployment page where you can see a running log of the deployment status. Once completed, the app is ready to be launched.

When to use Heroku

Heroku is one of the oldest cloud based platform hosting providers out there today. If you are running an application in any of the previously mentioned languages, then it would definitely be worth the time to run through a complete Heroku deployment.

Heroku has continously succeeded in taking the complexity and difficulty of managing servers and databases and simplified them down to an easy to use and abstracted layer.

I personally use Heroku to host my personal blogs, portfolios and hobby projects. And knowing that I can easily scale my server up with the click of a slider is a very liberating feeling.

Walter Guevara is a software engineer, startup founder and currently teaches programming for a coding bootcamp. He is currently building things that don't yet exist.

Comments

No messages posted yet

Developer Poll

Q:

Stay up to date

Sign up for my FREE newsletter. Get informed of the latest happenings in the programming world.

Add a comment

Keep me up to date on the latest programming news
Add Comment

Stay up to date

Get informed of the latest happenings in the programming world.

No thanks