Heroku is a cloud service for hosting your applications. It is a Platform as a service with support for auto-scaling and deployment. It primarily uses Git for deploying applications. It is is a cloud-based platform that provides application developers an environment ready to code, test and run an app without needing to worry about the infrastructure details.
We can currently deploy apps written in the following languages :
Applications that run on Heroku usually have a unique domain (typically “applicationname.herokuapp.com”) that routes HTTP requests to the correct dyno. The containers used at Heroku are called “dynos.” Dynos are isolated, virtualized Linux containers that are designed to execute code based on a user-specified command. Each of the application containers or dynos are spread across a “dyno grid” which consists of several servers. Heroku’s Git server handles application repository pushes from permitted users.
Heroku makes it dead simple to :
- Deploy your rails app via command line using git and heroku toolbelt.
- Add add-ons like sendgrid , newrelic , cloudinary with a single command.
- Rollback to previous versions , as it maintains complete versioning history .
- Run your website virtually free during initial stages , when you are using starter version of add-ons and your website stores less data on heroku .
All Heroku services are hosted on Amazon’s EC2 cloud computing platform.
The working can be summarized into two major categories- specifically Deploy & Runtime
The following two sections recapitulate the main components of the platform, separating them into these two buckets.
– The main contents of the development are the source code, related dependencies if they exist, and a Procfile for the command.
-The application is sent to Heroku using either of the following: Git, GitHub, Dropbox, or via an API.
-There are packets which take the application along with all the dependencies, and the language runtime, and produce slugs. These are known as build-packs and are the means for the slug compilation process.
-A slug is a combination/bundle of the source code, built dependencies, the runtime, and compiled/generated output of the build system which is ready for execution.
-Next is the Config vars which contain the customizable configuration data that can be changed independently of the source code.
-Add-ons are third party, specialized, value-added cloud services that can be easily attached to an application, extending its functionality.
– A release is a combination of a slug (the application), config vars and add-ons.
-Heroku maintains a log known as the append-only ledger of releases the developer makes.
-The main unit which provides the run environment are the Dynos which are isolated, virtualized unix containers.
-The application’s dyno formation is the total number of currently-executing dynos, divided between the various process types the developer has scaled.
-The dyno manager is responsible for managing dynos across all applications running on Heroku.
-Applications that use the free dyno type will sleep after 30 minutes of inactivity. Scaling to multiple web dynos, or a different dyno type, will avoid this.
-One-off Dynos are temporary dynos that run with their input/output attached to the local terminal. They’re loaded with the latest release.
-Each dyno gets its own ephemeral filesystem with a fresh copy of the most recent release. It can be used as temporary scratchpad, but changes to the filesystem are not reflected to other dynos.
-Logplex automatically collates log entries from all the running dynos of the app, as well as other components such as the routers, providing a single source of activity.
-Scaling an application involves varying the number of dynos of each process type.
A diagrammatic view of the working of Heroku Platform is shown below.
To conclude, Heroku is a constantly expanding and improving platform for easily deploying a wide range of web-based projects with an advantage of deploying web applications with limited features of heroku for Free. In short, this means that it is a framework that makes it easier for developers to develop, deploy and test many applications.