"Agile Infrastructure" / "Agile System Administration"
"10 Deploys per Day: Dev and Ops Cooperation at Flickr"
|Declarative formats for setup automation||Minimizes time and cost for new developers|
|Clean contract with the OS||Maximizes portability|
|Deployable on modern cloud platforms||Minimizes servers and sysadmins|
|Repeatable builds/deployments||Minimizes diff between dev and prod, enables CD|
|Scalable without significant changes to tooling, architecture, or practices|
All environments from trunk / master
A twelve-factor app never relies on implicit existence of system-wide packages
Use your package manager!
Twelve-factor apps also do not rely on the implicit existence of any system tools.
If the app needs to shell out to a system tool, that tool should be vendored into the app.
Config is everything that is likely to vary between deploys
Does not include internal application config, such as
The twelve-factor app stores config in environment variables
Scales up smoothly as the app naturally expands into more deploys over its lifetime.
12 Factor says nothing about how environment variables get set
A twelve-factor app makes no distinction between local and third party services
Any data that needs to persist must be stored in a stateful backing service, typically a database.
Sticky sessions are a violation of twelve-factor and should never be used or relied upon.
node --port 5000
rails server -p 5000
php -S http://localhost:5000
dotnet --urls http://*:5000
resist the urge to use different backing services between development and production