Table of Contents

  1. Codebase
  2. Dependencies
    • Concept
  3. Config
  4. Backing Services
  5. Build, Release, Run
  6. Processes
  7. Port Binding
  8. Concurrency
  9. Disposability
  10. Dev/Prod Parity
  11. Logs
  12. Admin Processes

The 12factor.net website discusses the best technique to develop web apps or software as a service. So, I'm going over these 12 factors and using this list as the foundation, but I am going to cover items they don't mention.

Myth : 12 Factor is a silver bullet for all cloud deployments.

Reality: While 12 Factor provides excellent guidelines, it's not a one-size-fits-all solution. Consider adapting its principles to your specific project needs and infrastructure constraints.

Introduction

A group of people within Heroku developed the 12 Factors manifesto describing the rules and guidelines that needed to be followed to build a cloud-native application in 2011. Currently Azure, AWS, GCP, and Oracle are the leaders in the cloud, not Heroku. However, most of it is still relevant today.

How do you create a cloud-based app so that it is robust, scalable, efficient, and cost-effective?

First of all, let's understand what are an app and a cloud:

App:

Cloud:

Enter, the Twelve Factors:


The 12 Factor App's main concepts are briefly explained in the section below.

1. Codebase

One codebase tracked in revision control, many deploys

If you found a bug then go to the previous version fix it and then build the code again. These can be deployed to various environments, such as testing, staging, and live production servers. It helps you to do easily CI/CD process for your applications.


2. Dependencies

Explicitly declare and isolate dependencies

War (web application archive) vs Jar(java archive)

Concept

  1. declaring dependency & bundling (also called vendoring)

2. dependency isolation

Main Goal

3. Config

store config in the environment

Configuration manifest

Environment variables, zookeeper, spring cloud config, etc


4. Backing Services

Treat backing services as attached resources


5. Build, Release, Run

Strictly separate build & run stages


6. Processes

Executes the app as one or more stateless processes


7. Port Binding

Export services via port binding


8. Concurrency

Scale out via the process model


9. Disposability

Maximize robustness with fast startup and graceful shutdown


10. Dev/Prod Parity

Keep development, staging & production as similar as possible


11. Logs

Treat logs as event streams


12. Admin Processes

Run admin tasks as one-off processes

Instead

Conclusion

In cloud computing, building applications demands agility, scalability, and resilience. The 12 Factor App guides developers towards creating applications that seamlessly produce in cloud environments. If you are just starting your cloud journey, the 12-Factor App methodology is worth exploring. Its principles offer a solid foundation for building modern, cloud-native applications that can adapt and flourish in the face of continuous change.

References:


Send me a direct message on X , If you're curious or have any questions on the subject; I'd be pleased to chat with you!

Also published here.