12 / 15 Factor App
Adopt
The [12-factor](https://12factor.net/ app methodology, originally developed by Heroku, provides a comprehensive set of best practices for building cloud-native applications. This methodology emphasizes creating applications that are easy to manage, scalable, and portable across different environments. The 15-factor model extends this framework to address additional concerns relevant in modern cloud-native development.
Core Principles of 12-Factor Apps
- Codebase: Maintain a single codebase tracked in version control, with multiple deployments.
- Dependencies: Explicitly declare and isolate dependencies.
- Config: Store configuration in the environment.
- Backing Services: Treat backing services as attached resources.
- Build, Release, Run: Strictly separate build and run stages.
- Processes: Execute the app as one or more stateless processes.
- Port Binding: Export services via port binding.
- Concurrency: Scale out via the process model.
- Disposability: Maximize robustness with fast startup and graceful shutdown.
- Dev/Prod Parity: Keep development, staging, and production as similar as possible.
- Logs: Treat logs as event streams.
- Admin Processes: Run admin/management tasks as one-off processes.
Extending to 15 Factors
The 15-factor model builds upon the original principles by adding:
- API First: Design APIs first to ensure interoperability and future-proofing.
- Telemetry: Implement robust telemetry for monitoring and diagnostics.
- Authentication and Authorization: Incorporate strong, centralized authentication and authorization mechanisms.