Tuesday, April 1, 2025

Extending 12-Factor app to 15 Factor

 The 12 Factor app

The 12 Factor app is a methodology to build cloud native applications.

https://12factor.net/


As the name suggests, there are 12 factors.

  1. Codebase - Maintain a single source of truth. Single repo for same app.

  2. Dependencies - Use dependency managers (PIP for python, Nuget for .NET)

  3. Config - Use environment variables, do not commit config files in source control

  4. Backend services - DB/Cache/Messaging queue should be external services

  5. Build-Release-Run - Build stage compiles code, Release stage combine release artifacts, Run stage executes app

  6. Processes - Keep application stateless. Save sessions in db/cache

  7. Port Bindings - Self contained app should listen on a port.

  8. Concurrency - scale by running multiple instances (horizontal scale instead of vertical scale)

  9. Disposability - app should start quickly and shut down gracefully.

  10. Dev/Prod Parity - Developers should use similar environments in dev and prod

  11. Logs - Write logs to stdout instead of files. Use centralized logging system (ELK)

  12. Admin processes - DB migrations or maintenance script as separate tasks.

15 Factor

https://developer.ibm.com/articles/15-factor-applications/

The 12 Factor app was created almost a decade ago and cloud technologies have advanced since their original creation. So 3 additional factors were added.

  1. API first - If API is not clearly defined, it can be a nightmare in integration.

  2. Telemetry - Real time app monitoring (performance, health, key metrics)

  3. Authentication-Authorization - Secure cloud native application endpoints with role based access control (RBAC)

No comments: