An overview of Heroku's architecture

The Heroku architecture consists of a platform stack comprising of the language runtime, various libraries, the operating system, and the underlying infrastructure to support development of scalable web apps.

The high-level architecture of the Heroku platform is shown as follows:

An overview of Heroku's architecture

Process management

The dyno manifold (DM) is the foundational block for the execution environment on the Heroku platform. It is a distributed, fault-tolerant, and horizontally scalable execution environment for application dynos. It manages the entire diversity of process type instances via the process model in an automated way with zero maintenance cost.

The unit of work in the Heroku platform is called a dyno. Dynos are fully-isolated, highly available (virtual) containers running on the dyno manifold.

Dynos receive web requests from routing mesh, connect to application resources such as a database, for example, using environment variables, and write an output to the log message sink called Heroku Logplex.

A process type defines the template to be used to instantiate a particular process. It is a declaration of a command. The command is executed when a dyno of that process type is started. There are at least two process types available on Heroku—web and worker. An instance of web process type typically handles HTTP client requests. The router directs all the requests to the web process type. The instance of the worker process type is used to execute other tasks such as custom jobs of long running background jobs and queuing tasks. Heroku also provides the flexibility to create additional process type based on specific needs.

A process is an instance of a particular process type. The Procfile specifies the various process types and how to run them on the Heroku platform.

Logging

Logplex routes log streams originating from various sources, such as application tasks, system components, and backend services into a single output pool. Additional filters can be used to search specific log messages, hence providing flexible logging facilities.

HTTP routing

The requests (dashed vertical lines) for a web resource (for example, web page) are routed to the appropriate web process dyno using the Routing mesh. Incoming requests are received by a load balancer that automatically routes HTTP requests to specific dynos through this mesh. The Routing mesh is responsible for determining the location of the application's web dynos within the dyno manifold and forwarding the HTTP request to one of these dynos.

Heroku interfaces

Heroku provides various control surfaces such as process management, routing, logging, scaling, configuration, and deployment for building and operating an application. These are available as a command-line interface (CLI), a web-based console, as well as a full REST API. These control surfaces provide the application developer with the flexibility to control various aspects of the application through multiple touch points.