Building Cloud Native APPs using 12-factor
The 12-factor app is a set of best practices for building software-as-a-service (SaaS) applications that are portable, maintainable, and scalable. It was created by a group of software engineers with experience in building SaaS apps and aims to provide a guide for developing apps that can be deployed to any cloud platform.
The 12 factors include:
Codebase: Each application should have only one codebase, managed through a version control system like Git.
Dependencies: Explicitly declare and isolate dependencies to ensure that the app is self-contained and portable.
Configuration: Store configuration in the environment rather than in the app code.
Backing services: Treat backing services (like databases, caches, and message brokers) as attached resources that can be swapped out or scaled independently.
Build, release, run: Separate the build, release, and run stages of the app lifecycle and keep them distinct.
Processes: Use stateless processes to handle requests, making it easy to scale up or down.
Port binding: Export services via port binding and make them available over the network.
Concurrency: Scale out by adding more processes, rather than increasing the size of existing processes.
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 and aggregate and centralize them.
Admin processes: Run admin/management tasks as one-off processes, rather than as part of the application.
Following these principles, developers can create applications that are easy to maintain, deploy, and scale. While the 12-factor methodology is not a rigid set of rules, it provides valuable guidelines that can be adapted to suit the needs of each application.
Subscribe to my newsletter
Read articles from Rafey Ahmed directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Rafey Ahmed
Rafey Ahmed
Aspiring software developer | Back-end development ( Nodejs) | Cloud practitioner (AWS, Gcloud) | DevOps Enthusiast| Open Source