> Home > ADRs > ADR-012 Use 12-factor application principles
Date: 2022-06-01
Confirmed
Architectural erosion is a recurrent problem faced by software architects. Despite this fact, the process is usually tackled in ad hoc way, without adequate tool support at the architecture level. To address this issue, we describe the preliminary design of a recommendation system whose main purpose is to provide refactoring guidelines for developers and maintainers during the task of reversing an architectural erosion process.
The 12 Factor App is a methodology developed by the team at Heroku in 2012. It defines a set of rules (known as the 12 Factor App Principles) to follow when building SaaS applications.
To avoid the cost of software erosion. To control the dynamics of organic growth of an app over time. To Improve collaboration between developers working on same app's codebase.
Use declarative formats for setup automation, to minimize time and cost for new developers joining the project; Have a clean contract with the underlying operating system, offering maximum portability between execution environments; Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems administration; Minimize divergence between development and production, enabling continuous deployment for maximum agility; And can scale up without significant changes to tooling, architecture, or development practices.
We decided we are going to adhere to following 12 factor application principals:
One codebase tracked in revision control, many deploys
Explicitly declare and isolate dependencies
Store config in the environment
Treat backing services as attached resources
Strictly separate build and run stages
Execute the app as one or more stateless processes
Export services via port binding
Scale out via the process model
Maximize robustness with fast startup and graceful shutdown
Keep development, staging, and production as similar as possible
Treat logs as event streams
Run admin/management tasks as one-off processes
Positive:
- Avoid the cost of software erosion
- Controls the dynamics of organic growth of an app over time
- Improves collaboration between developers working on same app’s codebase
- Apps can grow and shrink in response to demand, saving you infrastructure costs.
Negative:
Risks:
Bonus Features:
- Entropy Kills Software
- Erosion Resistance
- Twelve-Factor Applications
- The New Heroku (Part 4 of 4): Erosion-resistance & Explicit Contracts
- Recommending Refactorings to Reverse Software Architecture Erosion