SaaS: The Twelve-Factor app methodology explained

The Twelve-Factor App methodology is a methodology for building software-as-a-service applications. These best practices are designed to enable applications to be built with portability and resilience when deployed to the web.

To understand this metho…


This content originally appeared on DEV Community and was authored by Carlos Loredo

The Twelve-Factor App methodology is a methodology for building software-as-a-service applications. These best practices are designed to enable applications to be built with portability and resilience when deployed to the web.

12-factors_img
To understand this methodology we can divide the twelve factors into 3 key components:
12-factors-3-components
Next, we'll see the best practices that you should follow for every factor to comply with what this methodology says.

Code Factors:

Factor 1 - CodeBase:

codebase_img

  • Code must be tracked in a version control system (VCS) like Github, BitBucket, etc.
  • One-to-One relationship between the CodeBase and the application.
  • There can be multiple deploys of the application.
  • Different versions of the CodeBase can be in each deployment.

Factor 5 - Build, release and run:

build_release_run_img

  • Build: Transform a CodeBase into an executable unit called build.
  • Release: Combine build with configuration so that it's ready to run.
  • Run: Runs the application.

Factor 10 - Dev/Prod parity:

dev_prod_img

  • Minimize differences between deployment and production environments.
  • Back-end services should be the same across environments (dev/prod)

Deploy Factors:

Factor 2 - Dependencies:

dependecy_img

  • Be aware that an app is only reliable as its least reliable dependency.
  • Be sure that code explicitly declares any dependency.

Factor 3 - Config:

config_img

  • Config contains everything that varies between deploys such as credentials and backing services locations.
  • Configs must be kept separate from the code
  • Store config in environment variables.

Factor 4 - Backing services:

back_end_img

  • Applications should not distinguish between local and third-party back-end services.
  • All services should be accessed by URL and credentials so that can be swapped without changing the code.

Factor 6 - Processes:

process_img

  • Stateless and share nothing.
  • Backing services store persistent data since memory and filesystems are not shared across processes.
  • Data is centrally stored.

Factor 7 - Port binding:

ports_img

  • Export services by port binding. HTTP and other services are exported in this way.
  • To bind a port usually you must declare a web server library.
  • Applications can be backing services for other applications.

Factor 9 - Disposability:

disposability_img

  • Applications should have minimal process start-time and graceful termination.
  • Quickly deploy code and configure changes.
  • Easily scale applications.

Factor 11 - Logs:

logs_img

  • Applications should not concern themselves with storing logs.
  • Applications should trend logs as event stream written to stdout.
  • Execution environment captures the stream for all apps aggregates the logs and routes logs to their destination.

Operate Factors:

Factor 8 - Concurrency:

concurrency_img

  • Concurrent processes can be used to scale the application.
  • Stateless processes can be spun up without creating dependencies on other processes.

Factor 12 - Admin processes:

admin_process_img

  • Enable one-off application management processes such as database migration.
  • Run against a release using the same CodeBase configuration.
  • Are included in the application code.

Sources:

  • The Twelve-Factors Methodology website: 12factor


This content originally appeared on DEV Community and was authored by Carlos Loredo


Print Share Comment Cite Upload Translate Updates
APA

Carlos Loredo | Sciencx (2021-06-20T23:45:40+00:00) SaaS: The Twelve-Factor app methodology explained. Retrieved from https://www.scien.cx/2021/06/20/saas-the-twelve-factor-app-methodology-explained/

MLA
" » SaaS: The Twelve-Factor app methodology explained." Carlos Loredo | Sciencx - Sunday June 20, 2021, https://www.scien.cx/2021/06/20/saas-the-twelve-factor-app-methodology-explained/
HARVARD
Carlos Loredo | Sciencx Sunday June 20, 2021 » SaaS: The Twelve-Factor app methodology explained., viewed ,<https://www.scien.cx/2021/06/20/saas-the-twelve-factor-app-methodology-explained/>
VANCOUVER
Carlos Loredo | Sciencx - » SaaS: The Twelve-Factor app methodology explained. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/20/saas-the-twelve-factor-app-methodology-explained/
CHICAGO
" » SaaS: The Twelve-Factor app methodology explained." Carlos Loredo | Sciencx - Accessed . https://www.scien.cx/2021/06/20/saas-the-twelve-factor-app-methodology-explained/
IEEE
" » SaaS: The Twelve-Factor app methodology explained." Carlos Loredo | Sciencx [Online]. Available: https://www.scien.cx/2021/06/20/saas-the-twelve-factor-app-methodology-explained/. [Accessed: ]
rf:citation
» SaaS: The Twelve-Factor app methodology explained | Carlos Loredo | Sciencx | https://www.scien.cx/2021/06/20/saas-the-twelve-factor-app-methodology-explained/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.