Skip to main content

The 12-Factor App Methodology

00h 02m 18s

What is the 12-Factor App methodology?

the-12-factor-app-methodology-banner.svg

The 12-Factor App is a methodology for building scalable and maintainable software-as-a-service (SaaS) applications. It provides a set of guidelines for developing modern, cloud-native, and containerized applications.

We believe this methodology to be of such high importance that every software should follow it. At Peopleoid, we follow this methodology for every project we work on.

In this story, we'll explain the 12 factors in a short, concise manner, so everyone can understand what it's about.

1. Codebase

code-base.svg
  • Maintain one codebase per application.
  • Use a single, version-controlled code repository for your application even for multiple development environments.

2. Dependencies

dependencies.svg
  • Explicitly declare and isolate dependencies.
  • Have a clear and well-documented list of dependencies, and make sure they are isolated from the host system.

3. Config

config.svg
  • Store configuration in environment variables.
  • Application configuration (such as credentials) should be stored as environment variables and therefore separated from code.

4. Backing Services

backing-services.svg
  • Treat external services (such as databases, caches, etc.) as attached resources.
  • Connect to them via URLs or environment variables.

5. Build, Release, Run

build-release-run.svg
  • Strictly separate the build, release, and run stages of the application.
  • Use consistent and repeatable build processes.

6. Processes

processes.svg
  • Execute the application as one or more stateless processes.
  • Applications should be designed to be stateless and capable of horizontal scaling.

7. Port Binding

port-binding.svg
  • Export services via port and communicate over the network.
  • Applications should export services via a port-binding mechanism, making them self-contained and easy to deploy.

8. Concurrency

concurrency.svg
  • Scale out via the process model.
  • Applications should be designed to scale horizontally by adding more processes as needed.

9. Disposability

disposability.svg
  • Maximize robustness with fast startup and graceful shutdown.
  • Applications should be able to terminate unneeded processes without impact.

10. Dev/Prod Parity

dev-prod-parity.svg
  • Keep development, staging, and production environments as similar as possible.
  • The goal is to minimize the differences between development and production environments to reduce issues when deploying.

11. Logs

logs.svg
  • Treat logs as event streams.
  • Write application logs to standard output and allow log aggregation.

12. Admin Processes

admin-processes.svg
  • Run administrative or management tasks as one-off processes.
  • Administrative tasks should be executed as separate, one-off process, rather than building complex management interfaces into the application.

Conclusion

These factors are meant to guide developers in creating applications that are easy to deploy, maintain, and scale in modern cloud-based environments.

By following these principles, you can increase the resilience, maintainability, and scalability of your applications while making them more suitable for continuous integration and continuous delivery (CI/CD) practices.

Share this story:

Contact Us

Take the first step of your journey today, let us help you build a unique software that stands out from the crowd and creates a ripple effect of success.

Contact Peopleoid