The 12 Factors App for Modern Software Development

CHAIRI Chaimae
3 min readFeb 4, 2024

--

In my quest to grasp the essence of my profession, I’ve encountered the cornerstone pillars of software development: code, deploy and operate.

If you share the same passion as me, you can join me on an enchanting journey through the modern symphony of software development, where innovation and efficiency intertwine in perfect harmony.

Within this dynamic landscape of sofatware engineering where web apps are dilivered as SaaS (software-as-a-service), the Twelve-Factor App Methodology stands out as the guiding beat for developers striving to achieve a seamless fusion of scalability, resilience, and agility. Crafted by Adam Wiggins in 2011, this approach transforms web apps from mere lines of code into dynamic, living entities that thrive in the digital sphere.

* Code Factors

Codebase

The foundation of a twelve-factor app lies in its codebase, tracked diligently in a version control system like Git. A single codebase is dedicated to each app, while multiple deploys may exist with different versions. This flexibility allows changes to be present in development or test environments before reaching production.

Build, Release, and Run

The journey from code to production involves three distinct stages: build, release, and run.

  • The build stage compiles code and gathers dependencies to create an executable build.
  • The release stage combines the build with the current deployment’s configuration, preparing the code for execution.
  • The run stage then implements the application. Moreover, strict separation of these stages ensures consistency and reliability.

Dev/Prod Parity

Minimizing differences between development and production environments is crucial for continuous delivery. This factor ensures that code runs consistently across different environments and catches potential issues early in the development process.

Dependencies

Explicitly declaring dependencies is a fundamental principle. By doing so, there’s no assumption that dependencies already exist on a developer’s machine. This promotes a consistent and reproducible development environment.

* Deploy Factors:

Config

This factor encapsulates variations in configuration between different deployments. It discourages the practice of storing configuration as constants within the code. Instead, it advocates for storing configurations in environment variables. Consequently, this provides a flexible approach that facilitates effortless adjustments across deployments without the need to modify the code.

Backend Services

Twelve-factor apps treat local and third-party services uniformly, accessible through a URL or locator information. This allows developers to swap out backend services without code changes, and enhance flexibility.

Processes

Applications execute as stateless, independent processes. Persistent data is stored in backend services to ensure data centralization and avoid interdependencies among processes.

Port Binding

Web-facing services should bind to a port to export HTTP or other services. This factor enhances accessibility and transforms apps into backend services for other applications.

* Operate Factors:

Concurrency

Processes within an application are stateless and share nothing. As a result, this allows for horizontal scaling. Additional processes can be started to handle increased load without creating interdependencies.

Disposability

Application processes require minimal startup time and should end gracefully when terminated. So, quick startup facilitates swift deployment of code or configuration changes and enables easy scaling.

Logs

Visibility into application performance is achieved through logs. Applications should not concern themselves with storing logs. Instead, logs are treated as a stream of events written to standard output, allowing the execution environment to handle aggregation and routing.

Admin Processes

One-off processes for managing applications, like database migrations, are included in this factor. Admin processes run against a release using the same codebase and configuration. As a result, this ensures synchronization with the app.

To figure out more about this subject, you can visit this website:

The Twelve-Factor App (12factor.net)

In conclusion, these factors serves as a guiding light for software development. By focusing on these principles such as codebase management, deployment consistency, and operational efficiency, developers can create applications that adapt to the dynamic digital landscape.

As we navigate the intricacies of modern technology, the shift towards Software as a Service (SaaS) aligns harmoniously with the Twelve-Factor principles.

Furthermore, embracing both the Twelve-Factor App Methodology and the SaaS model empowers developers to build resilient, cloud-native applications that cater to the ever-evolving demands of the digital era. This symbiotic relationship ensures that software not only meets today’s challenges but is also well-positioned for tomorrow’s innovations.

--

--

CHAIRI Chaimae
CHAIRI Chaimae

Written by CHAIRI Chaimae

This space's to document my learning and track my progress. Hope it helps someone somewhere. You're welcomed!

No responses yet