12factor
12factor, or the 12-Factor App, is a set of guidelines for building software-as-a-service applications designed to be portable, scalable, and maintainable when deployed to modern cloud environments. It was introduced by engineers at Heroku, notably Adam Wiggins, in the early 2010s as a practical framework for designing applications that run as stateless processes and rely on backing services. The methodology emphasizes declarative configuration, clean separation of code and environment, and robust deployment practices.
1) Codebase: one codebase tracked in revision control, many deploys for different environments.
2) Dependencies: explicitly declare and isolate dependencies; avoid implicit system dependencies.
3) Config: store config in the environment; separate config from code.
4) Backing services: treat backing services (databases, queues, caches) as attached resources.
5) Build, release, run: strictly separate build, release, and run stages.
6) Processes: execute the app as one or more stateless processes.
7) Port binding: export services by binding to a port, making the app self-contained.
8) Concurrency: scale out via the process model; manage instances as independent processes.
9) Disposability: fast startup and graceful termination; maximize robustness during deployment.
10) Dev/prod parity: keep development, staging, and production as similar as practical.
11) Logs: treat logs as event streams; aggregate and route to a log indexing service.
12) Admin processes: run administrative/maintenance tasks as one-off processes.
Impact and usage: the approach influenced cloud-native and container-based deployment patterns, emphasizing automation, portability, and scalable