Heroku Overview for Developers

John Stevenson

jr0cket

Lets start with a demo

Overview of Heroku

Platform as a Service (PaaS)

heroku-overview-concept.png

Highly scalable deployment platform

Developer focused

Use Git to securely transfer code to Heroku

git push heroku master
heroku-developer-workflow--push.png

Heroku deployment process (simplified)

Flexible Language support

heroku-languages-supported.png

Ruby, Node.js, Python & Java

  • community buildpacks for everything else
  • fork / create your own buildpacks

Scalable platform

Scale your apps "instantly"

heroku-dashboard-resources-scaling-node-example.png

Continuous Deployment

Who uses Heroku

Startups who need to find the right idea

Enterprises that need to innovate

success.heroku.com

Getting Started

Create a free account

www.heroku.com

Install Heroku Toolbelt

toolbelt.heroku.com

Securely identify yourself with Heroku

heroku login

Developing your first app on Heroku

Start developing your app

  • using what ever language you like

Version your app with Git

git init 
git add .
git commit -m "meaningful message"
git-local-workflow.png

Create an app on Heroku

Connects your local Git repository to Heroku Creates a unique URL for your app

heroku create
heroku create unique-name
heroku create --region eu|us
heroku-developer-workflow--create.png

Deploy your app

Push your committed code to Heroku securely

git push heroku master
heroku-developer-workflow--push.png

Heroku deployment process (simplified)

Continuous Deployment

heroku-continuous-delivery.png

Tracable Deployment

Git version numbers used to label each Heroku deployment

  • trace which version is deployed using Git log
git-log-commit-graph-decorate-oneline-abbrev-commit.png

Dashboard Activity trail

Audit trail of activity for your app deployment

heroku-dashboard-activity-first-deployment.png

Heroku Dashboard in detail

heroku-dashboard-overview-example.png

Collaborating with Heroku

Allow other developers to deploy new versions

heroku-dashboard-access-example.png

Collaborating with Heroku Orgs

Support collaboration across a company and its partners

heroku-dashboard-org-access.png

Developer worlflow with Heroku

heroku-developer-team-workflow-overview.png

Developer worlflow with Github and Heroku

heroku-developer-team-workflow-with-github.png

Running and Scaling your app

heroku-scalability-concept.png

Defining Processes

Procfile defines all the different processes in your app

Heroku Process Model

Web & other process types

web: listens on http/https

worker: one off process jobs

call processes other than web anything you like

Scaling a process

heroku-scalability-concept.png

Scale a process up or down, instantly

heroku ps:scale web=4
heroku ps:scale worker=2

Example Node app with multiple process

heroku-dashboard-scaling-processes-node-example.png

Auto Scaling

Services available in the Heroku addons marketplace

  • analyse the performance of your code first though

Guiding Principles

12factor.net

Managing Apps

Consistent Environments

Dev, Test, QA, Staging, Production all from same codebase

  • automated creation of environments
  • automated deployment
  • minimises errors
  • repeatable process

Environment Variables

Manage differences in environments easily Avoid hard coding configuration

heroku config

Heroku Logs

Heroku logplex: all your logs in one stream

heroku logs --tail
heroku logs --source app | ps | heroku

Longer term Logging

Heroku Addons

  • Logly
  • Papertrail

Releases

Every Git Push is a Release Every Environment Variable change is a Release Every Addon service is a Release

heroku releases
heroku releases:info v42

Rollbacks

Instantly roll back to a previous version

heroku releases:rollback
heroku releases:rollback v42

Accessing the server, safely

Spin up a copy of your app and access via secure shell

heroku run bash 
heroku run bundle ...
heroku-toolbelt-run-bash-explore.png

Performance metrics

Heroku Metrics New Relic

Working with Addon services

Datastores and services to support your apps

addons.heroku.com

Postgres

Database on demand

www.heroku.com/postgres

Thank you

www.heroku.com