What is The Twelve-Factor App?

Turkish: 12-Factor App

The Twelve-Factor App is a methodology for building portable SaaS services by separating code, config, dependencies, processes, and runtime concerns.

What is the Twelve-Factor App?

The Twelve-Factor App is a set of application design principles collected by the Heroku team for services that run reliably on cloud platforms. The core idea is that an app should behave the same way across environments and should not depend on hand-tuned server state.

In this model, the codebase lives in version control, dependencies are declared explicitly, configuration is supplied through environment variables, and backing services are attached as replaceable resources. Application processes are stateless; durable data belongs in databases, queues, object storage, or other managed services. Logs are written to the output stream so the hosting platform can collect and route them.

What the Principles Improve

  • Repeatable deployments: Development, staging, and production can be built from the same dependency declarations.
  • Safer configuration: Secrets and API keys stay out of source code and are injected by the runtime or a secret manager.
  • Horizontal scaling: Web, worker, and scheduled process types can be scaled independently.
  • Faster recovery: Instances are treated as disposable, so restarts and replacements become normal operations.

Business Use

Twelve-Factor practices are most useful for SaaS products, customer portals, and API services that ship frequently. They help teams keep staging close to production, separate customer-specific configuration, and make DevOps pipelines predictable.

The methodology is not a substitute for architecture decisions. File-heavy workloads, local caching, or long-running batch jobs may require additional storage and coordination patterns. For a new SaaS web application, applying the principles early can reduce later migration and scaling friction.