Twelve-Factor App
Also known as: 12-factor app, Twelve-factor methodology
Methodology of twelve principles for building portable, scalable web applications and services, published by engineers at the cloud platform Heroku.
The Twelve-Factor App is a set of guidelines for designing software-as-a-service applications that deploy cleanly to cloud platforms, scale easily and keep development and production environments consistent. It was published around 2011 by engineers at Heroku, a platform-as-a-service company, with Heroku co-founder Adam Wiggins as its principal author. The methodology distilled lessons from running very large numbers of applications on Heroku's platform into twelve concise principles, presented on a website rather than in a book.
The factors are: one codebase tracked in version control with many deploys; explicitly declared and isolated dependencies; configuration stored in the environment rather than in code; backing services such as databases treated as attached resources; strict separation of build, release and run stages; execution as stateless processes; services exported through port binding; concurrency achieved by scaling out processes; disposability through fast startup and graceful shutdown; parity between development and production; logs treated as event streams; and administrative tasks run as one-off processes.
Many of these ideas became standard in cloud-native development and shaped how containers and platforms such as Kubernetes are commonly used, particularly stateless processes that enable horizontal scaling. Some recommendations have attracted criticism over time. Storing configuration, including secrets, in environment variables is convenient but can expose credentials through logs and child processes, so many teams now combine it with dedicated secrets management tools. The methodology remains a widely cited checklist for evaluating whether an application is ready to run in a cloud environment.
Key points
- Heroku engineers, led by Adam Wiggins, published the Twelve-Factor App methodology around 2011.
- Key principles include stateless processes, configuration in the environment and dev-production parity.
- The methodology strongly influenced container-based and cloud-native application design.
- Storing secrets in environment variables, as the methodology suggests, has known security drawbacks.
Related entries
Horizontal Scaling
Increasing a system's capacity by adding more machines or instances that share the work, rather than making a single machine more powerful.
Container
Lightweight, isolated package that bundles an application with its dependencies and configuration so it runs consistently across environments.
Microservices
Architectural style that builds an application as a suite of small, independently deployable services, each running its own process and owning its data.
Cloud Computing
Delivery of computing resources such as servers, storage, databases and software over a network on demand, with users paying for what they use.
Secrets Management
Tools and practices for securely storing, distributing, rotating and auditing credentials such as passwords, API keys, tokens and encryption keys.
Kubernetes
Open-source system for automating deployment, scaling and management of containerized applications across clusters of machines.
Version Control
System that records changes to files over time so that people can track history, revert mistakes and collaborate on the same codebase.