The 12-factor app is a set of important criteria for an application to strive in a modern technology world. The benefits of following these 12 principles come in the areas of development performance, teams benefiting from best practices, future-proof architecture, and integration.
Understanding 12 factors on a conceptual level using practical examples is the goal of the talk.
2. So what are the Twelve Factors?
The Twelve Factors aren’t rules set in stone.
They are not strictly necessary to follow to achieve the same result.
Same as Patterns or Refactorings they are guidelines and approaches that one can follow to
make your software scalable and future-proof.
● Applicable to any programming language with any backends
● Suitable for all sizes of apps and facilitates organic growth
● Facilitates architecture and clean contract between infrastructure, runtime and
application
● Minimizing the cost of onboarding new developers by using shared approaches,
concepts and terminology
3. I. Codebase
One codebase tracked in revision control, many
deploys
II. Dependencies
Use dependency management: declare (and fix)
dependencies and resolve them during the build
III. Config
Store config in the environment
IV. Backing services
Treat backing services as attached resources
V. Build, release, run
Strictly separate build and run stages
VI. Processes
Execute the app as one or more stateless
processes
VII. Port binding
Export services via port binding
VIII. Concurrency
Scale out via the process model
IX. Disposability
Maximize robustness with fast startup and
graceful shutdown
X. Dev/prod parity
Keep development, staging, and
production as similar as possible
XI. Logs
Treat logs as event streams
XII. Admin processes
Run admin/management tasks as one-off
processes
The Twelve Factors at a glance
17. So what are the new challenges?
App
State (Session, DB,
Messaging, Caches)
Ephemeral instances - they
come and go - as needed
Provisioning &
Deployment
(Code, Versions,
Runtime, Environment)
Maintenance &
Monitoring
App
App
App
18. And if that was not enough of a challenge….
State (Session, DB,
Messaging, Caches)
Ephemeral instances
Provisioning & Deployment
(Code, Versions, Runtime,
Environment)
Maintenance &
Monitoring
State (Session, DB,
Messaging, Caches)
Ephemeral instances - they come and
go - as needed
Provisioning & Deployment
(Code, Versions, Runtime,
Environment)
Maintenance &
Monitoring
State (Session, DB,
Messaging, Caches)
Ephemeral instances
Provisioning & Deployment
(Code, Versions, Runtime,
Environment)
Maintenance &
Monitoring
Dev
Test
Prod
19. Aspects of the Twelve Factors
Building and Releasing
Deployment and Running
Environment provisioning
Operations and Monitoring
Architecture and State
20. Building and Releasing
I. Codebase
One codebase tracked in revision control, many deploys
One-to-one correlation between the codebase and the app
II. Dependencies
Use dependency management: declare dependencies and
resolve them during the build
Fix dependency versions and prevent dependency leaks
V. Build, release, run
Strictly separate build and run stages
21. Environment provisioning
IX. Disposability
Maximize robustness with fast
startup and graceful shutdown
III. Config
Store config in the environment
X. Dev/prod parity
Keep development, staging, and
production as similar as possible
22. Deployment and Running
V. Build, release, run
Strictly separate build and run stages
VI. Processes
Execute the app as one or more
stateless and share-nothing processes
VII. Port binding
Export services via port binding
No containers, self-contained
VIII. Concurrency
Scale out via the process model
IX. Disposability
Maximize robustness with fast
startup and graceful shutdown
XII. Admin processes
Run admin/management tasks as
one-off processes.
Same codebase, same release,
same environment, same config
23. Architecture and State
III. Config
Store config in the environment
IV. Backing services
Treat backing services as
attached resources
VI. Processes
Execute the app as one or more
stateless processes
VII. Port binding
Export services via port binding
VIII. Concurrency
Scale out via the process model
IX. Disposability
Maximize robustness with fast
startup and graceful shutdown
24. Operations and Monitoring
XI. Logs
Treat logs as event streams
IV. Backing services
Treat backing services as attached resources
IX. Disposability
Maximize robustness with fast startup and graceful
shutdown
25. Whoooh.... Anything else?
● DevOps
● Containerization
● Microservices
● Zero downtime updates
● Blue/green deployment
● Config server
● CI/CD
● Circuit Breakers
● 15 factors
● Infrastructure as a code
● Cross-service traceability
● Much more...