SlideShare a Scribd company logo
The Twelve Factor Apps
Tomi Vanek, November 2015
http://12factor.net/
sportrider.com, totalmotorcycle.com, autoevolution.com
sportrider.com, totalmotorcycle.com, autoevolution.com
Scalable and reliable
Flexible to extend / change
Easy to run and administer
Extremely
The Twelve Factors
7. Port binding
8. Concurrency
9. Disposability
10. Dev/Prod parity
11. Logs
12. Admin processes
1. Codebase
2. Dependencies
3. Config
4. Backing Services
5. Build, release, run
6. Processes
Application
Architecture
Developm
ent
Operations
Application
Architecture
Developm
ent
Operations
Building Block
Code &
Configuration
Composite
Application
Build & Run
Building Block
Stateless
Small code base
Code & Configuration
Protection against software
erosion
Distributed development
Composite Application
Modular
Scalable and reliable
Open infrastructure
Lang/platform independence
Build & Run
Easy to deploy
Faster feature delivery
Quality first development
Application
Architecture
Developm
ent
Operations
Building Block
Code &
Configuration
Composite
Application
Build & Run
Execute the app as one or more stateless processes
! Processes: Stateless (no state in memory, on disc), share
nothing
! Application is self-contained (no app server)
! Any persistent data stored in stateful backing service
(typically database)
! NO sticky sessions
6. Processes
Scale out via the process model
Process Formation
8. Concurrency
! Scalability per processes
! Each process type (service type) is scaled
independently according requirements
! NO “daemonization” (background
services) - instead explicit process
manager for start / stop / restart and
stream management of processes
! Each running process writes its event stream, unbuffered, to
stdout
! Stream captured by the execution environment and routed
to one or more final destinations for viewing and long-term
archival (Splunk)
! Archival destinations are managed by the execution
environment (not configurable by the app)
Treat logs as event streams
11. Logs
Application
Architecture
Developm
ent
Operations
Building Block
Code &
Configuration
Composite
Application
Build & Run
Treat backing services as attached resources
4. Backing Services
! Attached resources, accessed via a URL or
other locator/credentials stored in the
configuration
! No distinction between local and remote
services
! Resources can be attached and detached
to deploys
Export services via port binding
! Services published / available per HTTP URL + port
! Process binding to a port
! May be also other communication protocols than HTTP (XMPP, Redis, …)
7. Port Binding
! Processes can be started or stopped at a moment’s notice
! Minimize process startup time (few seconds)
! Shut down gracefully the processes when they receive a SIGTERM signal from
the process manager (refusing any new requests, allowing any current requests
to finish, and then exiting)
Maximise robustness

with fast startup and graceful shutdown
9. Disposability
Requirements:
! HTTP request: short processing time (few seconds)
! Long polling: client is able to reconnect after connection
! Worker processes: return current job to the work queue
! All jobs are reentrant (transactions or idempotent operations)
! Robust against sudden death, in the case of a failure in the underlying hardware
9. Disposability
Application
Architecture
Developm
ent
Operations
Building Block
Code &
Configuration
Composite
Application
Build & Run
1. Codebase
! One codebase per app.
! Each component in a distributed system is an app,
and each can individually comply with twelve-factor.
! Do not share the same code in multiple apps. Refactor
shared code into libraries which can be included
through the dependency manager.
One codebase tracked in revision control, many deploys
Explicitly declare and isolate dependencies
2. Dependencies
! Do not rely on the implicit existence of system-wide packages and
tools. No future guarantees of existence or version compatibility.
! Declare all dependencies, completely and exactly, via a dependency
declaration manifest.
! Use a dependency isolation tool during execution to ensure that no
implicit dependencies “leak in” from the surrounding system.
! Applied uniformly to both production and development.
Store config in the environment
Node.js:
Java
:
3. Configuration
! Strict separation of config from code.
! Config varies substantially across deploys,
code does not.
! “Config” does not include internal application
config. This type of config does not vary
between deploys
! Independently managed for each deploy.
Never grouped together as “environments”.
Operations
Application
Architecture
Developm
ent
Building Block
Code &
Configuration
Composite
Application
Build & Run
Strictly separate build and run stages
5. Build, Release, Run
! Build stage: transformed

compiled code & packaged assets + dependencies --> build (executable bundle)
! Release stage: build + config

immediately executable in an execution environment
! Run stage: runtime

runs app in execution stage
! Time gap: minimize time to promote code to production
! Personnel gap: programmers participate on deployment,
observe app in production
! Tools gap: avoid different backing services / infrastructure
(DB, MQ, cache, OS, …)
Keep dev, staging and production as similar as possible
10. Development / Production Parity
Run admin/management tasks as one-off processes
! Run admin tasks in the same release / runtime environment
as the app (same code base, same configuration)
! REPL (admin console in app environment) for running
arbitrary code, or inspect application’s models: shell
commands inside the application
12. Admin Processes
Application
Architecture
Developm
ent
Operations
Building Block
(6) Processes
(8) Concurrency
(11) Logs
Code & Configuration
(1) Code base
(2) Dependencies
(3) Configuration
Composite Application
(4) Backing service
(7) Port binding
(9) Disposability
Build & Run
(5) Build, release, run
(10) Dev / prod parity
(12) Admin processes

More Related Content

What's hot

PHP Symfony MicroServices Migration @MeeticTech
PHP Symfony MicroServices Migration @MeeticTechPHP Symfony MicroServices Migration @MeeticTech
PHP Symfony MicroServices Migration @MeeticTech
meeticTech
 
Mix Tech Ed Update No Video
Mix Tech Ed Update No VideoMix Tech Ed Update No Video
Mix Tech Ed Update No VideoAllyWick
 
Frappe framework
Frappe framework Frappe framework
Frappe framework
eurosigdoc acm
 
Securely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rdsSecurely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rdsConcentrated Technology
 
nOOb-1.1-Dev-Env-pt-II.ppt
nOOb-1.1-Dev-Env-pt-II.pptnOOb-1.1-Dev-Env-pt-II.ppt
nOOb-1.1-Dev-Env-pt-II.pptwebhostingguy
 
Continuous integration / deployment with Jenkins
Continuous integration / deployment with JenkinsContinuous integration / deployment with Jenkins
Continuous integration / deployment with Jenkinscherryhillco
 
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
eleksdev
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practicesCode Mastery
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
Yoshan madhumal
 
Improving software quality using Continuous Integration
Improving software quality using Continuous IntegrationImproving software quality using Continuous Integration
Improving software quality using Continuous Integration
Wouter Konecny
 
Mobile Test Automation using one API and one infrastructure
Mobile Test Automation using one API and one infrastructureMobile Test Automation using one API and one infrastructure
Mobile Test Automation using one API and one infrastructure
Michael Palotas
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
Knoldus Inc.
 
IIS for Developers
IIS for DevelopersIIS for Developers
IIS for Developers
Ido Flatow
 
Continuous integration with teamcity
Continuous integration with teamcityContinuous integration with teamcity
Continuous integration with teamcityEugene Sheretov
 
Continuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and DeployitContinuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and DeployitXebiaLabs
 
Nightly build done right
Nightly build done rightNightly build done right
Nightly build done rightLiora Milbaum
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
Sachin-QA
 
Training web @GITS
Training web @GITSTraining web @GITS
Training web @GITS
Rakhmatullah Yoga
 

What's hot (20)

PHP Symfony MicroServices Migration @MeeticTech
PHP Symfony MicroServices Migration @MeeticTechPHP Symfony MicroServices Migration @MeeticTech
PHP Symfony MicroServices Migration @MeeticTech
 
Mix Tech Ed Update No Video
Mix Tech Ed Update No VideoMix Tech Ed Update No Video
Mix Tech Ed Update No Video
 
Frappe framework
Frappe framework Frappe framework
Frappe framework
 
Rapidly deploying software
Rapidly deploying softwareRapidly deploying software
Rapidly deploying software
 
Securely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rdsSecurely connecting to apps over the internet using rds
Securely connecting to apps over the internet using rds
 
nOOb-1.1-Dev-Env-pt-II.ppt
nOOb-1.1-Dev-Env-pt-II.pptnOOb-1.1-Dev-Env-pt-II.ppt
nOOb-1.1-Dev-Env-pt-II.ppt
 
rajendra resume -new
rajendra resume -newrajendra resume -new
rajendra resume -new
 
Continuous integration / deployment with Jenkins
Continuous integration / deployment with JenkinsContinuous integration / deployment with Jenkins
Continuous integration / deployment with Jenkins
 
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practices
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Improving software quality using Continuous Integration
Improving software quality using Continuous IntegrationImproving software quality using Continuous Integration
Improving software quality using Continuous Integration
 
Mobile Test Automation using one API and one infrastructure
Mobile Test Automation using one API and one infrastructureMobile Test Automation using one API and one infrastructure
Mobile Test Automation using one API and one infrastructure
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
IIS for Developers
IIS for DevelopersIIS for Developers
IIS for Developers
 
Continuous integration with teamcity
Continuous integration with teamcityContinuous integration with teamcity
Continuous integration with teamcity
 
Continuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and DeployitContinuous delivery with Jenkins Enterprise and Deployit
Continuous delivery with Jenkins Enterprise and Deployit
 
Nightly build done right
Nightly build done rightNightly build done right
Nightly build done right
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Training web @GITS
Training web @GITSTraining web @GITS
Training web @GITS
 

Similar to The Twelve Factor Apps

Twelve factor apps
Twelve factor appsTwelve factor apps
Twelve factor apps
Alea Soluciones, S.L.
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor app
Ravi Okade
 
Best software development tools in 2021
Best software development tools in 2021Best software development tools in 2021
Best software development tools in 2021
Samaritan InfoTech
 
Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?
Phil Estes
 
Microservices
MicroservicesMicroservices
Microservices
Abdelrahman Badreldeen
 
Cloud Native Development
Cloud Native DevelopmentCloud Native Development
Cloud Native Development
Manuel Garcia
 
Twelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application ArchitectureTwelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application Architecture
Sigfred Balatan Jr.
 
Let's banish "it works on my machine"
Let's banish "it works on my machine"Let's banish "it works on my machine"
Let's banish "it works on my machine"
Stephanie Locke
 
apidays LIVE Paris - Serverless security: how to protect what you don't see? ...
apidays LIVE Paris - Serverless security: how to protect what you don't see? ...apidays LIVE Paris - Serverless security: how to protect what you don't see? ...
apidays LIVE Paris - Serverless security: how to protect what you don't see? ...
apidays
 
Hello cloud 6
Hello  cloud 6Hello  cloud 6
Hello cloud 6
Gireesh Kumar
 
Philipe Riand - Building Social Applications using the Social Business Toolki...
Philipe Riand - Building Social Applications using the Social Business Toolki...Philipe Riand - Building Social Applications using the Social Business Toolki...
Philipe Riand - Building Social Applications using the Social Business Toolki...
LetsConnect
 
Meet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento CloudMeet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento Cloud
Lyzun Oleksandr
 
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
Teodoro Cipresso
 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for Change
Eric Wyles
 
10 Reasons Why You Should Consider Google App Engine (GAE) for Your Next Project
10 Reasons Why You Should Consider Google App Engine (GAE) for Your Next Project10 Reasons Why You Should Consider Google App Engine (GAE) for Your Next Project
10 Reasons Why You Should Consider Google App Engine (GAE) for Your Next Project
Abeer R
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.js
Brad Williams
 
Serverless security - how to protect what you don't see?
Serverless security - how to protect what you don't see?Serverless security - how to protect what you don't see?
Serverless security - how to protect what you don't see?
Sqreen
 
12-Factor App
12-Factor App12-Factor App
12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready Solutions12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready Solutions
Kashif Ali Siddiqui
 
Stateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystemsStateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystems
Nuno Caneco
 

Similar to The Twelve Factor Apps (20)

Twelve factor apps
Twelve factor appsTwelve factor apps
Twelve factor apps
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor app
 
Best software development tools in 2021
Best software development tools in 2021Best software development tools in 2021
Best software development tools in 2021
 
Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?
 
Microservices
MicroservicesMicroservices
Microservices
 
Cloud Native Development
Cloud Native DevelopmentCloud Native Development
Cloud Native Development
 
Twelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application ArchitectureTwelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application Architecture
 
Let's banish "it works on my machine"
Let's banish "it works on my machine"Let's banish "it works on my machine"
Let's banish "it works on my machine"
 
apidays LIVE Paris - Serverless security: how to protect what you don't see? ...
apidays LIVE Paris - Serverless security: how to protect what you don't see? ...apidays LIVE Paris - Serverless security: how to protect what you don't see? ...
apidays LIVE Paris - Serverless security: how to protect what you don't see? ...
 
Hello cloud 6
Hello  cloud 6Hello  cloud 6
Hello cloud 6
 
Philipe Riand - Building Social Applications using the Social Business Toolki...
Philipe Riand - Building Social Applications using the Social Business Toolki...Philipe Riand - Building Social Applications using the Social Business Toolki...
Philipe Riand - Building Social Applications using the Social Business Toolki...
 
Meet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento CloudMeet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento Cloud
 
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for Change
 
10 Reasons Why You Should Consider Google App Engine (GAE) for Your Next Project
10 Reasons Why You Should Consider Google App Engine (GAE) for Your Next Project10 Reasons Why You Should Consider Google App Engine (GAE) for Your Next Project
10 Reasons Why You Should Consider Google App Engine (GAE) for Your Next Project
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.js
 
Serverless security - how to protect what you don't see?
Serverless security - how to protect what you don't see?Serverless security - how to protect what you don't see?
Serverless security - how to protect what you don't see?
 
12-Factor App
12-Factor App12-Factor App
12-Factor App
 
12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready Solutions12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready Solutions
 
Stateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystemsStateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystems
 

Recently uploaded

Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 

Recently uploaded (20)

Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 

The Twelve Factor Apps

  • 1. The Twelve Factor Apps Tomi Vanek, November 2015 http://12factor.net/
  • 4. Scalable and reliable Flexible to extend / change Easy to run and administer Extremely
  • 5. The Twelve Factors 7. Port binding 8. Concurrency 9. Disposability 10. Dev/Prod parity 11. Logs 12. Admin processes 1. Codebase 2. Dependencies 3. Config 4. Backing Services 5. Build, release, run 6. Processes
  • 8. Building Block Stateless Small code base Code & Configuration Protection against software erosion Distributed development Composite Application Modular Scalable and reliable Open infrastructure Lang/platform independence Build & Run Easy to deploy Faster feature delivery Quality first development
  • 10. Execute the app as one or more stateless processes ! Processes: Stateless (no state in memory, on disc), share nothing ! Application is self-contained (no app server) ! Any persistent data stored in stateful backing service (typically database) ! NO sticky sessions 6. Processes
  • 11. Scale out via the process model Process Formation 8. Concurrency ! Scalability per processes ! Each process type (service type) is scaled independently according requirements ! NO “daemonization” (background services) - instead explicit process manager for start / stop / restart and stream management of processes
  • 12. ! Each running process writes its event stream, unbuffered, to stdout ! Stream captured by the execution environment and routed to one or more final destinations for viewing and long-term archival (Splunk) ! Archival destinations are managed by the execution environment (not configurable by the app) Treat logs as event streams 11. Logs
  • 14. Treat backing services as attached resources 4. Backing Services ! Attached resources, accessed via a URL or other locator/credentials stored in the configuration ! No distinction between local and remote services ! Resources can be attached and detached to deploys
  • 15. Export services via port binding ! Services published / available per HTTP URL + port ! Process binding to a port ! May be also other communication protocols than HTTP (XMPP, Redis, …) 7. Port Binding
  • 16. ! Processes can be started or stopped at a moment’s notice ! Minimize process startup time (few seconds) ! Shut down gracefully the processes when they receive a SIGTERM signal from the process manager (refusing any new requests, allowing any current requests to finish, and then exiting) Maximise robustness
 with fast startup and graceful shutdown 9. Disposability
  • 17. Requirements: ! HTTP request: short processing time (few seconds) ! Long polling: client is able to reconnect after connection ! Worker processes: return current job to the work queue ! All jobs are reentrant (transactions or idempotent operations) ! Robust against sudden death, in the case of a failure in the underlying hardware 9. Disposability
  • 19. 1. Codebase ! One codebase per app. ! Each component in a distributed system is an app, and each can individually comply with twelve-factor. ! Do not share the same code in multiple apps. Refactor shared code into libraries which can be included through the dependency manager. One codebase tracked in revision control, many deploys
  • 20. Explicitly declare and isolate dependencies 2. Dependencies ! Do not rely on the implicit existence of system-wide packages and tools. No future guarantees of existence or version compatibility. ! Declare all dependencies, completely and exactly, via a dependency declaration manifest. ! Use a dependency isolation tool during execution to ensure that no implicit dependencies “leak in” from the surrounding system. ! Applied uniformly to both production and development.
  • 21. Store config in the environment Node.js: Java : 3. Configuration ! Strict separation of config from code. ! Config varies substantially across deploys, code does not. ! “Config” does not include internal application config. This type of config does not vary between deploys ! Independently managed for each deploy. Never grouped together as “environments”.
  • 23. Strictly separate build and run stages 5. Build, Release, Run ! Build stage: transformed
 compiled code & packaged assets + dependencies --> build (executable bundle) ! Release stage: build + config
 immediately executable in an execution environment ! Run stage: runtime
 runs app in execution stage
  • 24. ! Time gap: minimize time to promote code to production ! Personnel gap: programmers participate on deployment, observe app in production ! Tools gap: avoid different backing services / infrastructure (DB, MQ, cache, OS, …) Keep dev, staging and production as similar as possible 10. Development / Production Parity
  • 25. Run admin/management tasks as one-off processes ! Run admin tasks in the same release / runtime environment as the app (same code base, same configuration) ! REPL (admin console in app environment) for running arbitrary code, or inspect application’s models: shell commands inside the application 12. Admin Processes
  • 26. Application Architecture Developm ent Operations Building Block (6) Processes (8) Concurrency (11) Logs Code & Configuration (1) Code base (2) Dependencies (3) Configuration Composite Application (4) Backing service (7) Port binding (9) Disposability Build & Run (5) Build, release, run (10) Dev / prod parity (12) Admin processes