12factor.net — The Twelve-Factor App
A methodology for building software-as-a-service apps published by Adam Wiggins and the Heroku team at https://12factor.net/.
Summary
The twelve-factor methodology was distilled from experience operating and deploying millions of apps on the Heroku platform. It describes twelve principles for building cloud-native, horizontally scalable, deployable applications.
Key Takeaways
- Codebase — One codebase, many deploys; shared code via dependency managers, not shared repos.
- Dependencies — Explicitly declare all dependencies; no implicit system-level packages.
- Config — Store config in environment variables; never in code or named environment groups.
- Backing Services — Local and remote services are interchangeable attached resources.
- Build, Release, Run — Three separate, immutable stages; releases are versioned.
- Processes — Stateless, share-nothing processes; all persistence via backing services.
- Port Binding — App is self-contained, binds its own port.
- Concurrency — Scale by adding stateless processes, not by threading.
- Disposability — Fast startup, graceful shutdown; crash-resilient.
- Dev/Prod Parity — Minimize time, personnel, and tools gaps between environments.
- Logs — Write to stdout; let the platform route and store.
- Admin Processes — Run as one-off processes in the same environment as the app.
Wiki Pages That Cite This Source
- Twelve-Factor App — full treatment of all 12 factors
- Continuous Integration and Delivery — Factor V (Build/Release/Run)
- Infrastructure as Code — Factor IV and Factor X
- Blue-Green Deployment — Factor IX (Disposability)
- Canary Release — Factor V (immutable releases)