Marco Alabruzzo
http://marcoala.com
London Django Meetup Group
Web Developer - Growth Street
marco.alabruzzo@gmail.com
19 January 2016
Heroku is a cheap and convenient way to host your web application, is easy to start and is scalable.
Money
Time
A cheaper and easier solution to host application mean a smaller initial investment approaching django.
Platform-as-a-service
Infrastructure-as-a-service
It’s a delivery model where instead of delivering a software we deliver the service that the software offer.
The advantage for the user is that he doesn't need to do any kind of maintenance or specific hardware.
Computing resources over the internet.
Choose OS, manage users, manage SSH key, configure a firewall, install a database etc.
Computing resources over the internet.
Everything is already installed and ready for deploy your application, and is also kept up-to-date.
Infrastructure and operations are handled for you.
Hotel
Furnished
Unfurnished
When you need a particular control over your machine
hardware requirment
other software
storage on the same machine
When you have already have system administrators and/or dev ops
A lightweight Linux container that runs a single user-specified command
Procfile
web: gunicorn myproject.wsgi --log-file -
Web
Worker
One-off
heroku ps:scale web=2
heroku ps:scale web+1
heroku ps:scale web=3 worker=1
Web
Worker
They add services functionalities to your application with no or minimal configuration.
They can be internal heroku services or integration with third party application.
Heroku Postgre
Amazon S3
New Relic
RabbitMQ
Mandrill
Scheduler
SSL
Gemfury
150+ add-ons
Buildpacks are collection of OS level dependencies
The default of the heroku’s dynos, the Cedar stack, does not support any kind of programming languages. Languages are added through a buildpack.
Heroku maintain a set of language specific buildpacks: Ruby, Node.js, Clojure, Python, Java, Grandle, Grails, Scala, Play, PHP, Go.
If some specific dependencies are needed is possible to try to find a third party managed buildpack or build our own.
A buildpack can be just a combination of other buildpacks.
The buildpack create the environment (a build version of the buildpack).
Buildpack
Environment
The application slug is added to the environment (compressed and pre-packaged copy of your application).
Slug
Environment
Addons are added.
Slug
Database (addon)
Environment
Addons are added.
Slug
Database (addon)
Addons
Environment
Configuration is added
Slug
Database (addon)
Addons
Configuration
Environment
A new release object has been created!
Releases are immutable so is always possible to rollback and forward between releases.
release 1
release 2
release 3
release 4
release 5
Where do I put my static files?
Bucketeer
How can I upload and store files?
Direct to S3 File Uploads in Python
django-s3direct
The twelve-factor methodology can be applied to apps written in any programming language, and which use any combination of backing services (database, queue, memory cache, etc).
Advantage of a 12 factor application:
Maximum portability
cloud platforms
development/production
scale up
I. Codebase
II. Dependencies
III. Config
IV. Backing Services
V. Build, release, run
VI. Processes
VII. Port binding
VIII. Concurrency
IX. Disposability
X. Dev/prod parity
XI. Logs
XII. Admin processes
Question and feedback
marco.alabruzzo@gmail.com