One codebase tracked in revision control, many deploys
Explicitly declare and isolate dependencies
Store config in the environment
The app stores config in environment variables that are easy to change between deploys without changing any code. They are never grouped together as "environments" (does not scale), but instead are independently managed for each deploy.
Treat backing services as attached resources
The code for an app makes no distinction between local and third party services.
Strictly separate build and run stages
Execute the app as one or more stateless processes
Processes are stateless and share-nothing. Any data that needs to persist must be stored in a stateful backing service, typically a database. Sticky sessions are a violation and should never be used or relied upon.
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
Make the following gap as small as possible:
- The time gap: Time between writing code and deploy of it.
- The personell gap: Developers write code, ops deploy it.
- The tools gap: Development and production tools.
Treat logs as events streams
The app never concerns itself with routing or storage of its output.
Run admin/management tasks as one-off processes