The 12 Factor App

The 12 Factor App is a methodology for building modern, cloud-native applications that are scalable, portable, and maintainable. The 12 factors are a set of best practices that promote agility, flexibility, and reliability in application development, deployment, and operation.

The twelve factors are:

  1. Codebase - One codebase per application, version-controlled in a single repository.

  2. Dependencies - Explicitly declare and isolate dependencies.

  3. Configuration - Store configuration in the environment, not in code.

  4. Backing services - Treat backing services (e.g. databases, caches, message brokers) 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 via port binding.

  8. Concurrency - Scale out via the process model.

  9. Disposability - Maximize robustness with fast startup and graceful shutdown.

  10. Dev/prod parity - Keep development, staging, and production as similar as possible.

  11. Logs - Treat logs as event streams.

  12. Admin processes - Run admin/management tasks as one-off processes.

Adopting the 12 Factor App methodology can bring a number of benefits to application development and deployment, including:

  • Better scalability and availability: 12 Factor Apps can be easily scaled horizontally, making them more resilient to traffic spikes and ensuring high availability.

  • Improved portability: By keeping the application stateless and externalizing configuration and services, 12 Factor Apps can be easily deployed to different environments and platforms.

  • Faster development and deployment cycles: By strictly separating build, release, and run stages, and by using automation tools, 12 Factor Apps can be developed and deployed more quickly and with fewer errors.

  • Enhanced maintainability: By following best practices for code organization, dependency management, and process management, 12 Factor Apps are easier to maintain over time.

Overall, the 12 Factor App methodology provides a set of guidelines for building modern, cloud-native applications that are scalable, portable, and maintainable, and that can be easily deployed and operated in a variety of environments.

Last updated