The methodology was drawn up by Adam Wiggins and colleagues at Heroku, distilling the experience of developing and deploying hundreds of applications. The idea is simple: an application should not depend on where it is run — the same code, unaltered, works on a developer’s laptop, in a staging environment and in the cloud. The document is addressed to developers of SaaS applications and operations engineers.
The twelve principles
| Principle | Essence |
|---|---|
| I. Codebase | one codebase in version control — many deployments from it |
| II. Dependencies | dependencies are declared explicitly and isolated from the system |
| III. Config | settings live in the environment, not in the code |
| IV. Backing services | database, queue, cache — attachable resources addressed through configuration |
| V. Build, release, run | three strictly separated stages; a finished release cannot be changed — only a new one issued |
| VI. Processes | the application is one or more stateless processes sharing nothing |
| VII. Port binding | the application is self-contained and listens on its own port |
| VIII. Concurrency | scaling by adding processes, not by growing a single process |
| IX. Disposability | fast startup and graceful shutdown — a process can be replaced at any moment |
| X. Dev/prod parity | environments kept as similar as possible — the foundation of continuous delivery |
| XI. Logs | the log is a stream of events in stdout; the platform collects and stores it |
| XII. Admin processes | migrations and one-off scripts — the same codebase, in a one-off process |
What this changes in practice
The main consequence is the separation of code and configuration. The application reads its settings from the environment: the database address from DATABASE_URL, keys for external services from variables such as API_KEY. A single build suits every environment; only the environment changes. A backing service can be swapped without touching the code: a local database for a cloud one, an own mail server for a third-party service; only the address in the configuration changes.
DATABASE_URL=postgres://app@db.internal:5432/shopREDIS_URL=redis://cache.internal:6379S3_BUCKET=uploadsProcesses hold no state: files live in external storage, sessions in a shared database or cache. A process must start in seconds and shut down gracefully on the supervisor’s signal: stop taking new requests and finish the current ones. Then the process manager can move a process to another machine or replace a crashed one at any moment, and scaling comes down to launching additional instances.
Origin and boundaries
The authors borrowed the document’s format from Martin Fowler’s books “Patterns of Enterprise Application Architecture” and “Refactoring”. The methodology does not prescribe an architecture: the principles describe deployment and configuration, not how the code is structured, so a monolith and a set of microservices alike can follow them. The full Russian translation is available on the methodology’s website.
Sources
the term is written from these pagesVerified 8 Nov