The Twelve-Factor methodology is from 2011 but remains relevant. Here’s what matters in practice, and what’s become outdated.
The Factors, Ranked by Impact
Critical (Ignore at Your Peril)
III. Config in Environment
| |
Config includes credentials, per-environment values, and feature flags. Environment variables work everywhere: containers, serverless, bare metal.
VI. Stateless Processes
| |
If your process dies, can another pick up the work? Statelessness enables horizontal scaling, rolling deploys, and crash recovery.
X. Dev/Prod Parity
| |
“Works on my machine” usually means dev differs from prod. Docker Compose eliminates most of this.
Important (Worth Following)
IV. Backing Services as Attached Resources
| |
Your app shouldn’t care if Postgres is local or RDS. Same code, different config.
IX. Disposability
- Fast startup (seconds, not minutes)
- Graceful shutdown (finish requests, close connections)
- Crash-safe (can restart without corruption)
This enables auto-scaling and smooth deploys.
XI. Logs as Streams
| |
Let the platform handle log aggregation. Your app just writes to stdout.
Nice to Have (Context-Dependent)
I. One Codebase, Many Deploys
Monorepo vs polyrepo is a religious war. The real point: don’t copy-paste code between environments.
II. Explicit Dependencies
Pin versions. Use lockfiles. This is table stakes in 2026.
V. Build, Release, Run
Immutable artifacts. Never modify running code.
VII. Port Binding
| |
No Apache/nginx required inside your app. Reverse proxy sits in front.
VIII. Concurrency via Process Model
Scale by adding processes, not threads. Kubernetes/ECS does this naturally.
XII. Admin Processes
| |
Admin tasks use the same codebase and config as the app.
What’s Outdated
“One codebase tracked in revision control” - Monorepos and polyrepos both work. The factor was really about “don’t have slightly different code in prod vs staging.”
“Explicitly declare and isolate dependencies” - Everyone uses package managers now. This was revolutionary in 2011.
“Port binding” - With containers, this is automatic. You don’t think about it.
The Modern Interpretation
If I were rewriting twelve-factor today:
- Config in environment (still critical)
- Stateless processes (still critical)
- Logs to stdout (still critical)
- Graceful shutdown (added emphasis)
- Health checks (new factor)
- Immutable deploys (combines build/release/run)
- Backing services as URLs (still relevant)
- Dev/prod parity via containers (updated)
- Horizontal scaling (clarified)
- Observability (new: metrics, traces, logs)
Quick Compliance Check
| |
Twelve-factor isn’t a checklist to follow blindly. It’s a set of principles that make apps easier to deploy, scale, and operate. Use what helps, skip what doesn’t.