Let's explore each of the 12 factors in brief:
- Codebase: Maintain a single codebase tracked in version control, enabling multiple deployments while ensuring consistency and facilitating collaboration.
- Dependencies: Explicitly declare and isolate dependencies to eliminate surprises and ensure predictable behavior.
- Config: Store configuration in the environment to enhance flexibility and portability across different environments.
- Backing Services: Treat backing services (databases, caches, queues, etc.) as attached resources, enabling easy swapping and ensuring compatibility.
- Build, Release, Run: Strictly separate build, release, and run stages to facilitate consistent and reproducible deployments.
- Processes: Execute the application as one or more stateless processes, promoting scalability and resilience.
- Port Binding: Export services via port binding, ensuring that the application is self-contained and does not rely on runtime injection of a web server.
- Concurrency: Scale out via the process model, allowing individual components to be scaled independently for optimal performance.
- Disposability: Maximize robustness with fast startup and graceful shutdown, enabling quick recovery from failures.
- Dev/Prod Parity: Keep development, staging, and production environments as similar as possible to minimize discrepancies and streamline the deployment process.
- Logs: Treat logs as event streams to facilitate debugging and monitoring, ensuring visibility into the application's behavior.
- Admin Processes: Run admin/management tasks as one-off processes, separate from the application's main processes, to ensure stability and performance.
Embracing the principles of the 12 Factor App empowers developers to build software that is not only resilient and scalable but also adaptable to the ever-evolving demands of the digital landscape.
If you want to explore more in-depth, please check here: https://12factor.net