Skip to main content

What is Heroku? Getting Started with PaaS Development

So just what is Heroku? It’s a service for developers eager to get their applications online without having to worry about infrastructure details.

Metered, pay-as-you-go Cloud Computing services come in all kinds of flavors. Infrastructure as a Service (IaaS) offerings like AWS allow enterprises to shift their entire operations away from traditional data centers. The downside is that you’ll have to manage networking and provisioning yourself. On the other hand, Platform as a Service (PaaS) providers like Heroku, offer abstracted environments into which developers can simply drop their code and let the platform take care of the provisioning details. You’ll give up some control, but gain simplicity and speed in exchange.

Heroku itself, by the way, is built entirely on AWS cloud servers.

It uses Git (a distributed version control system for code management) to manage application deployments. All you’ll need to do to deploy your application on Heroku is push your Git repository to their servers.

What is Heroku and why are its application deployments so simple

Heroku…

  • Runs your application across a preset number of virtual servers.
  • Manages releases by rolling out your application to different environments.
  • Ensures your application automatically recovers from server failures.
  • Handles load balancing across many application instances, allowing you to instantly scale your application to support millions of users.
  • Allows you to quickly add and remove infrastructure blocks like caching servers and database servers.

Heroku supports the Ruby, Node.js, Python, Java, Go, PHP, and Scala programming languages. This provides easy deployment of existing technologies on Heroku with minimum modifications needed.

Building Blocks of Heroku

Dynos

Dynos, like AWS instances or Azure virtual machines, are individual virtual servers built on Ubuntu images. If your application runs on Ubuntu, it’ll be fine on Heroku. There are three types:

  • Web dynos: web instances running HTTP services.
  • Worker dynos: instances launched to process asynchronous jobs.
  • One-off dynos: temporary instances that can be loaded with your latest code release and run detached, or with their input/output attached to your local terminal. They can be used to handle administrative tasks like database migrations.

As of now, you can choose from these dyno sizes:
Heroku Dyno types and sizes
Heroku is particularly well known for being able to instantly scale the number of dynos up or down, but they also provide automated load balancing for incoming HTTP requests and failover between hosts. You don’t even have to know there was a problem.

Add-ons

Heroku supports a very large collection of third-party add-ons for users to instantly provision as attachable resources for their applications. Provisioning an add-on (the Papertrail application logger, in this case) is no more complicated than running a single command from your command line interface (CLI):

heroku addons:create papertrail

Each time you add an add-on to one of your applications, your application will automatically be assigned one or more environment variables, which specify any credentials you may need to interact with your new tool. In the case of Papertrail, you will have full access to your logs through the Heroku apps web interface.

Heroku database service

Heroku PostgreSQL, Heroku’s hosted, vertically scalable, database service that’s available in the cloud or on your local workstation, is similarly provisioned using:

heroku addons:create heroku-postgresql

But of course, being a database, the Heroku PostgreSQL is significantly more complicated to configure.

Heroku also offers High Availability and Automatic Failover with its DB.

Heroku architectural principles

Based on Heroku founder Adam Wiggen’s Twelve Factor App, you should ideally keep these considerations in mind when designing your Heroku deployments (or, for that matter, any deployments):

  • Version control and store your application in Git.
  • Declare and isolate dependencies.
  • Store your application configuration profile data in environment variables.
  • Design infrastructure elements to work as attachable modular resources.
  • Separate your build and run stages.
  • Design your application to be stateless so it can be easily reused.
  • Export services via port bindings
  • Scale-out your application using concurrency
  • Keep your development, staging, and production images as similar as possible.
  • Think of your logs as event streams.
  • Run admin processes as one-off tasks.

How Heroku Pricing Works

One of the benefits of using a cloud provider like Heroku in the first place is that you pay only for what you use. In the case of Heroku, since they bill in increments of seconds, that’s pretty much exactly what you use.

Quick-start Demo

Create your own free Heroku account. You will get 512 MB RAM, 1 web/1 worker, which is enough to get started deploying prototype applications.

We’ll work with a Rails application. Refer to this link for help setting up Rails on your workstation.

Download and install the Heroku ToolKit. This will create a local Heroku CLI client for creating and managing your Heroku applications and Git.

Login using the email and password you used for your Heroku account:

Heroku login

Clone your application from git:

Heroku clone application from Github

Now create an application on Heroku that will receive your Git source code:

Create Heroku application

Once complete, push your code:

git push "heroku master"

Each Heroku application is assigned a unique URL that automatically routes incoming HTTP requests to your application. Get your application using:

heroku open
Avatar

Written by

Nitheesh Poojary

My professional IT career began nine years back when I was just out of my college. I worked with a great team as an infrastructure management engineer, managing hundreds of enterprise application servers. I found my passion when I got the opportunity to work with Cloud technologies: I'm addicted to AWS Cloud Services, DevOps engineering, and all the cloud tools and technologies that make engineers' lives easier. Currently, I am working as a Solution Architect in SixNines IT. We are an experienced team of engineers that have helped hundreds of customers move to the cloud responsibly. I have achieved 5 AWS certifications, happily helping fellow engineers across the globe through my blogs and answering questions in various forums.

Related Posts

Avatar
Guy Hummel
— May 20, 2019

Preparing for the Microsoft AZ-900 Exam

Microsoft has offered Azure certification exams for years, but until recently, they were all meant for technical IT professionals. Now non-technical professionals, such as salespeople and managers, can take the new AZ-900 exam to prove their understanding of Azure fundamentals. People w...

Read more
  • Azure
Avatar
Thomas Mitchell
— May 16, 2019

An Overview of Azure Storage (Part 2)

Archive StorageArchive Storage offers the lowest storage costs of all Azure storage. Its retrieval costs, however, are higher when compared to Hot and Cool storage. The archive tier of storage is designed for data that can tolerate several hours of latency when being retrieved. It’s a...

Read more
  • Azure
  • Storage
Avatar
Thomas Mitchell
— May 14, 2019

An Overview of Azure Storage (Part 1)

Welcome to part one of our series on Azure Storage. Stay tuned for the second part. An Overview of Azure StorageMicrosoft Azure Storage is a cloud-based storage offering that provides multiple storage solutions for organizations. In addition to a massively scalable object store for ...

Read more
  • Azure
  • Storage
Avatar
Giacomo Marinangeli
— March 29, 2019

NEW: Custom Hands-On Labs for Azure and Google Cloud Platform

Harvard Business Review recently estimated that some 90% of corporate training never gets applied on the job. Given the $200B training industry, that is a staggering amount of waste. One reason for the disconnect? Lack of context.Cloud Academy’s platform was built to make it extraor...

Read more
  • Azure
  • Content Engine
  • Google Cloud Platform
  • Hands-on Labs
Avatar
Guy Hummel
— March 28, 2019

How to Become a Microsoft Certified Azure Solutions Architect

Microsoft Azure is the fastest growing cloud provider. Azure’s revenue grew an incredible 76% in the last quarter of 2018. As more and more businesses move their IT infrastructure to Microsoft’s cloud platform, the demand for Azure professionals keeps rising. Since there are relatively ...

Read more
  • Azure
Avatar
Nitheesh Poojary
— March 12, 2019

Understanding Object Storage and Block Storage Use Cases

Cloud Computing, like any computing, is a combination of CPU, memory, networking, and storage. Infrastructure as a Service (IaaS) platforms allow you to store your data in either Block Storage or Object Storage formats.Understanding the differences between these two formats - and how ...

Read more
  • Azure
  • Storage
Avatar
Thomas Mitchell
— January 29, 2019

What are Azure Blueprints?

What are Azure Blueprints?Blueprints, in the traditional sense, are used by architects and engineers to design and build new things.  They are used to ensure that the final products are built to specifications and in compliance with certain standards and requirements.Azure Bluepri...

Read more
  • Azure
  • Blueprints
Avatar
Thomas Mitchell
— January 22, 2019

Azure Hybrid Identity Authentication Methods

The move to the cloud is picking up steam.  As such, many corporations are beginning to find themselves supporting a mixture of on-prem apps as well as cloud apps. Users are finding that they need access to this mix of applications as well.  As one would expect, this can become a challe...

Read more
  • Azure
  • Hybrid Cloud
  • Hybrid Identity
Avatar
Andrew Larkin
— January 15, 2019

2018 Was a Big Year for Content at Cloud Academy

As Head of Content at Cloud Academy I work closely with our customers and my domain leads to prioritize quarterly content plans that will achieve the best outcomes for our customers.We started 2018 with two content objectives: To show customer teams how to use Cloud Services to solv...

Read more
  • AWS
  • Azure
  • Cloud Computing
  • Google Cloud Platform
Avatar
Dwayne Monroe
— December 17, 2018

Azure Internet of Things (Azure IoT) – An Introduction

IoT, or the ‘Internet of Things’, is an intriguing and rapidly growing technology that's bringing significant change to important elements of modern life. According to Gartner, IoT security spending alone is set to reach $1.5 billion during 2018.Like many newly minted terms, the def...

Read more
  • Azure
  • IoT
Avatar
Thomas Mitchell
— November 27, 2018

Azure Storage: A Service Overview

Azure Storage is a managed cloud storage offering from Microsoft.  It provides a scalable store for data objects, a cloud-based file system, and even provides a messaging and NoSQL store.  As a managed service, maintenance and support is handled by Microsoft Azure, taking the care and f...

Read more
  • Azure
  • Azure Storage
Avatar
Guy Hummel
— November 21, 2018

Google Cloud Certification: Preparation and Prerequisites

Google Cloud Platform (GCP) has evolved from being a niche player to a serious competitor to Amazon Web Services and Microsoft Azure. In 2018, research firm Gartner placed Google in the Leaders quadrant in its Magic Quadrant for Cloud Infrastructure as a Service for the first time. In t...

Read more
  • AWS
  • Azure
  • Google Cloud Platform