Contents

Heroku was initiawwy devewoped by James Lindenbaum,[4] Adam Wiggins,[5] and Orion Henry[6] for supporting projects dat were compatibwe wif de Ruby programming pwatform known as Rack.[7] The prototype devewopment took around six monds. Later on, Heroku faced drawbacks because of wack of proper market customers as many app devewopers used deir own toows and environment.[citation needed] In Jan 2009 a new pwatform was waunched which was buiwt awmost from scratch after a dree-monf effort. In October 2009, Byron Sebastian joined Heroku as CEO.[8] On December 8, 2010, Sawesforce.com acqwired Heroku as a whowwy owned subsidiary of Sawesforce.com. On Juwy 12, 2011, Yukihiro "Matz" Matsumoto, de chief designer of de Ruby programming wanguage, joined de company as Chief Architect, Ruby.[9] That same monf, Heroku added support for Node.js and Cwojure. On September 15, 2011, Heroku and Facebook introduced Heroku for Facebook.[10] At present Heroku supports Redis databases[11][12] in addition to its standard PostgreSQL.[13]

The name "Heroku" is merger of "heroic" and "haiku".[14][15] The Japanese deme is a nod to Matz for creating Ruby. The creators of Heroku did not want de name of deir project to have a particuwar meaning, in Japanese or any oder wanguage, and so chose to invent a name.

Appwications dat are run on Heroku typicawwy have a uniqwe domain (typicawwy "appwicationname.herokuapp.com") used to route HTTP reqwests to de correct dyno. Each of de appwication containers,[16] or dynos,[17] are spread across a "dyno grid" which consists of severaw servers. Heroku's Git server handwes appwication repository pushes from permitted users.[18][19]

Each dyno gets its own ephemeraw fiwesystem wif a fresh copy of de most recent rewease. It can be used as temporary scratchpad, but changes to de fiwesystem are not refwected to oder dynos.

Logpwex automaticawwy cowwates wog entries from aww de running dynos of de app, as weww as oder components such as de routers, providing a singwe source of activity.

Scawing an appwication invowves varying de number of dynos of each process type.

A detaiwed description of de architecture invowves-

Define de appwication:

The definition of de appwication i.e. de source code and de description is buiwt on de framework provided by Heroku which converts it into an appwication, uh-hah-hah-hah. The dependency mechanisms vary across wanguages: for Ruby de devewoper uses a Gemfiwe, in Pydon a reqwirements.txt, in Node.js a package.json, in Java a pom.xmw, and so on, uh-hah-hah-hah.

Knowing what to execute:

Devewopers don’t need to make many changes to an appwication in order to run it on Heroku. One reqwirement is informing de pwatform as to which parts of de appwication are runnabwe. This is done in a Procfiwe, a text fiwe dat accompanies de source code.[22] Each wine of de Procfiwe decwares a process type — a named command dat can be executed against de buiwt appwication, uh-hah-hah-hah.

Depwoying appwications:

Appwication devewopment on Heroku is primariwy done drough git. The appwication gets a new git remote typicawwy named as Heroku awong wif its wocaw git repository where de appwication was made. Hence to depwoy heroku appwication is simiwar to using de git push command.

There are many oder ways of depwoying appwications too. For exampwe, devewopers can enabwe GitHub integration so dat each new puww reqwest is associated wif its own new appwication, which enabwes aww sorts of continuous integration scenarios. Dropbox Sync wets devewopers depwoy de contents of Dropbox fowders to Heroku, or de Heroku API can be used to buiwd and rewease apps.

Depwoyment den, is about moving de appwication from a wocaw system to Heroku.

Buiwding appwications:

The mechanism for de buiwd is usuawwy different for different wanguages, but fowwows de consistent pattern of retrieving de specified dependencies, and creating any necessary assets (wheder as simpwe as processing stywe sheets or as compwex as compiwing code).The source code for de appwication, togeder wif de fetched dependencies and output of de buiwd phase such as generated assets or compiwed code, as weww as de wanguage and framework, are assembwed into a swug.

Running appwications on dynos:

Appwications in Heroku are run using a command specified in de Procfiwe, on a dyno dat’s been prewoaded wif a prepared swug (in fact, wif de rewease, which extends de swug, configuration variabwes and add-ons).

It's wike running dyno[21] as a wightweight, secure, virtuawized Unix container dat contains de appwication swug in its fiwe system. Heroku wiww boot a dyno, woad it wif de swug, and execute de command associated wif de web process type in de Procfiwe. Depwoying a new version of an appwication kiwws aww de currentwy running dynos and starts new ones (wif de new rewease) to repwace dem, preserving de existing dyno formation, uh-hah-hah-hah.

Configurations:

A customization of de existing configuration is possibwe as de configuration is done not widin de code but in a different pwace outside de source code. This configuration is independent of de code currentwy being run, uh-hah-hah-hah. The configuration for an appwication is stored in config vars.

At runtime, aww of de config vars are exposed as environment variabwes so dey can be easiwy extracted programaticawwy. A Ruby appwication depwoyed wif de above config var can access it by cawwing ENV["ENCRYPTION_KEY"]. Aww dynos in an appwication wiww have access to exactwy de same set of config vars at run-time.

Reweases:

The combination of swug and configuration is cawwed a rewease. Every time a new version of an appwication is depwoyed, a new swug is created and rewease is generated.

As Heroku contains a store of de previous reweases of de appwication, it’s designed to make it easier to roww back and depwoy a previous rewease. A rewease, den, is de mechanism behind how Heroku wets de devewoper modify de configuration of de appwication (de config vars) independentwy of de appwication source (stored in de swug) — de rewease binds dem togeder. Whenever de devewoper changes a set of config vars associated wif de appwication, a new rewease wiww be generated.

Dyno manager:

Dyno manager hewp maintain and operate de dynos created. Because Heroku manages and runs appwications, dere’s no need to manage operating systems or oder internaw system configuration, uh-hah-hah-hah. One-off dynos can be run wif deir input/output attached to de wocaw terminaw. These can awso be used to carry out admin tasks dat modify de state of shared resources, for exampwe database configuration, perhaps periodicawwy drough a scheduwer.

Add-ons:

Dynos do not share fiwe state, and so add-ons dat provide some kind of storage are typicawwy used as a means of communication between dynos in an appwication, uh-hah-hah-hah. For exampwe, Redis or Postgres couwd be used as de backing mechanism in a qweue; den dynos of de web process type can push job reqwests onto de qweue, and dynos of de qweue process type can puww jobs reqwests from de qweue. Add-ons are associated wif an appwication, much wike config vars, and so de earwier definition of a rewease needs to be refined. A rewease of de appwications is not just de swug and config vars; it’s de swug, config vars as weww as de set of provisioned add-ons.

Logging and monitoring:

Heroku treats wogs as streams of time-stamped events, and cowwates de stream of wogs produced from aww of de processes running in aww dynos, and de Heroku pwatform components, into de Logpwex- a high-performance, reaw-time system for wog dewivery. Logpwex keeps a wimited buffer of wog entries sowewy for performance reasons.

HTTP routing:

Heroku’s HTTP routers distribute incoming reqwests for de appwication across de running web dynos. A random sewection awgoridm is used for HTTP/HTTPS reqwest woad bawancing across web dynos. It awso supports muwtipwe simuwtaneous connections, as weww as timeout handwing.

The Heroku network runs de customer's apps in virtuaw containers which execute on a rewiabwe runtime environment, heroku cawws dese containers Dynos. These Dynos can run code written in Node, Ruby, PHP, Go, Scawa, Pydon, Java, Cwojure. Heroku awso provides custom buiwdpacks wif which de devewoper can depwoy apps in any oder wanguage. Heroku wets de devewoper scawe de app instantwy just by eider increasing de number of dyno or by changing de type of dyno de app runs in, uh-hah-hah-hah.

Heroku Postgres

Heroku Postgres is de Cwoud database (DBaaS) service form Heroku based on PostgreSQL. Heroku Postgres provides features wike continuous protection, rowwback and high avaiwabiwity and awso forks, fowwowers and datacwips

Heroku Redis

Heroku Redis is de customized Redis from Heroku to provide a better devewoper experience, it is fuwwy managed and is provided as a service by Heroku. It hewps in managing instances wif a CLI, associate data wif Postgres to gain business insights using SQL toows and wets customer gain performance visibiwity