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.

What is Heroku? 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 down side is that you’ll have to manage networking and provisioning yourself. On the other hand, Platform as a Service 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.

Heroku 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 pre-set 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 means existing technologies can be easily be deployed on Heroku with a minimum of modification needed.

What is Heroku: building blocks

Dynos

Dynos, like AWS instances or Azure virtual machines, are individual virtual servers. Dynos are built on Ubuntu images, which means that if your application can run on the Ubuntu, it’ll be fine on Heroku. There are three types of Dynos:

  • 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:
What is Heroku
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 CLI:

heroku addons:create papertrail

Each time you ‘add’ an addon 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 you development, staging, and production images as similar as possible.
  • Think of your logs as event streams.
  • Run admin processes as one-off tasks.


What is Heroku: 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.”
What is Heroku - prices

What is Heroku: quick-start demo

  • Create your own free Heroku account. You will get 512 MB RAM, 1 web/1 worker. This 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:
What is Heroku
  • Clone your application from git:
What is Heroku
  • Now create an application on Heroku that will receive your Git source code:
What is Heroku
  • Once you’re done with your changes, push your code:
git push "heroku master"
  • Each Heroku application is assigned a unique URL which automatically routes incoming HTTP requests to your application.You can get your application using:
heroku open

Written by

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

— 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
— October 30, 2018

Azure Stack Use Cases and Applications

This is the second of a two-part series covering Azure Stack. Our first post provided an introduction to Azure Stack. Why would your organization consider using Azure Stack? What are the key differences between Azure Stack and Microsoft Azure? In this post, we'll begin to answer bot...

Read more
  • Azure
  • Hybrid Cloud
  • Virtualization
— October 3, 2018

Highlights from Microsoft Ignite 2018

Microsoft Ignite 2018 was a big success. Over 26,000 people attended Microsoft’s flagship conference for IT professionals in sunny Orlando, Florida. As usual, Microsoft made a huge number of announcements, ranging from minor to major in importance. To save you the trouble of sifting thr...

Read more
  • Azure
  • Ignite
— September 20, 2018

Planning for Microsoft Ignite 2018 Sessions: What Not to Miss

Cloud Academy is proud to be a sponsor of the Microsoft Ignite Conference to be held September 24 - 28 in Orlando, Florida. This is Microsoft’s biggest event of the year and is a great way to stay up to date on how to get the most from Microsoft’s products. In this post, I’ll help you p...

Read more
  • Azure
— September 18, 2018

How to Optimize Cloud Costs with Spot Instances: New on Cloud Academy

One of the main promises of cloud computing is access to nearly endless capacity. However, it doesn’t come cheap. With the introduction of Spot Instances for Amazon Web Services’ Elastic Compute Cloud (AWS EC2) in 2009, spot instances have been a way for major cloud providers to sell sp...

Read more
  • AWS
  • Azure
  • Google Cloud
— August 23, 2018

What are the Benefits of Machine Learning in the Cloud?

A Comparison of Machine Learning Services on AWS, Azure, and Google CloudArtificial intelligence and machine learning are steadily making their way into enterprise applications in areas such as customer support, fraud detection, and business intelligence. There is every reason to beli...

Read more
  • AWS
  • Azure
  • Google Cloud
  • Machine Learning
— July 5, 2018

How Does Azure Encrypt Data?

In on-premises environments, data security is typically a siloed activity, with a company's security team telling the internal technology groups (server administration, database, networking, and so on) what needs to be protected against intrusion.This approach is absolutely a bad...

Read more
  • Azure
— June 26, 2018

Disadvantages of Cloud Computing

If you want to deliver digital services of any kind, you’ll need to compute resources including CPU, memory, storage, and network connectivity. Which resources you choose for your delivery, cloud-based or local, is up to you. But you’ll definitely want to do your homework first.Cloud ...

Read more
  • AWS
  • Azure
  • Cloud Computing
  • Google Cloud
Albert Qian
— June 19, 2018

Preparing for the Microsoft Azure 70-535 Exam

The credibility of Microsoft Azure continues to grow in the first quarter of 2018 with an increasing number of enterprises migrating their workloads, resulting in a jump for Azure from 10% to 13% in market share. Most organizations will find that simply “lifting and shifting” applicatio...

Read more
  • Azure
  • Compute
  • Database
  • Security
— April 12, 2018

Azure Migration Strategy: A Checklist to Get Started

By now, you’ve heard it many times and from many sources: cloud technology is the future of IT. If your organization isn’t already running critical workloads on a cloud platform (and, if your career isn’t cloud-focused), you’re running the very real risk of being overtaken by nimbler co...

Read more
  • Azure
— March 2, 2018

Three Must-Use Azure Security Services

Keeping your cloud environment safe continues to be the top priority for the enterprise, followed by spending, according to RightScale’s 2018 State of the Cloud report.The safety of your cloud environment—and the data and applications that your business runs on—depends on how well you...

Read more
  • Azure
  • Security
— February 15, 2018

Is Multi-Cloud a Solution for High Availability?

With the average cost of downtime estimated at $8,850 per minute, businesses can’t afford to risk system failure. Full access to services and data anytime, anywhere is one of the main benefits of cloud computing.By design, many of the core services with the public cloud and its underl...

Read more
  • AWS
  • Azure
  • Cloud Adoption
  • Google Cloud