SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
Twelve factor apps
The twelve-factor app is a methodology
for building software-as-a-service apps
that
● Use declarative formats for setup automation, to minimize time and cost for
new developers joining the project;
● Have a clean contract with the underlying operating system, offering
maximum portability between execution environments;
● Are suitable for deployment on modern cloud platforms, obviating the need for
servers and systems administration;
● Minimize divergence between development and production, enabling
continuous deployment for maximum agility;
● And can scale up without significant changes to tooling, architecture, or
development practices.
Background
● Inspired by developing and operating on the Heroku platform
● Tackle Organic growth of app
● Avoid software erosion
● Provide a shared vocabulary
● The format is inspired by Martin Fowler’s books Patterns of Enterprise
Application Architecture and Refactoring
12 factors
1. Codebase
One codebase tracked in revision control, many
deploys
1. Codebase
A twelve-factor app is always tracked in a version control system.
A codebase is any single repo (in a centralized revision control system like
Subversion), or any set of repos who share a root commit (in a decentralized
revision control system like Git).
If there are multiple codebases, it’s not an app – it’s a distributed system.
Multiple apps sharing the same code is a violation of twelve-factor. The solution
here is to factor shared code into libraries which can be included through the
dependency manager.
1. Codebase
There is only one codebase per app.
There might be many deploys of the app.
A deploy is a running instance of the app.
The codebase is the same across all deploys, although different versions may be
active in each deploy.
2. Dependencies
Explicitly declare and isolate dependencies
2. Dependencies
A twelve-factor app never relies on implicit existence of system-wide packages.
An app declares all dependencies, completely and exactly, via a dependency
declaration manifest.
An app uses a dependency isolation tool.
Apps do not rely on the implicit existence of any system tools. Examples include
shelling out to curl.
If an app needs to shell out to a system tool, that tool should be vendored into the
app
3. Configuration
Store config in the environment
3. Configuration
An app’s config is everything that is likely to vary between deploys
An app stores its config in environment variables
Env vars are easy to change between deploys without changing any code.
Env vars are granular controls, each fully orthogonal to other env vars
4. Backing services
Treat backing services as attached resources
4. Backing services
A backing service is any service the app consumes over the network as part of its
normal operation (DB, broker, object store, etc)
The code for a twelve-factor app makes no distinction between local and third
party services, both are attached resources, accessed via a URL or other
locator/credentials stored in the config. The services should be swappable without
code changes
Each distinct backing service is a resource.
Resources can be attached and detached to deploys at will.
4. Backing services
5. Build, release, run
Strictly separate build and run stages
5. Build, release, run
A codebase is transformed into a (non-development) deploy:
● The build stage converts a code repo into an executable bundle known as a
build. Using a version of the code at a commit specified by the deployment
process, the build stage fetches vendors dependencies and compiles binaries
and assets.
● The release stage takes the build and combines it with the deploy’s current
config. The resulting release contains both the build and the config and is
ready for immediate execution.
● The run stage (also known as “runtime”) runs the app in the execution
environment, by launching some set of the app’s processes against a
selected release.
5. Build, release, run
5. Build, release, run
The app uses strict separation between the build, release, and run stages
It is impossible to make changes to the code at runtime, since there is no way to
propagate those changes back to the build stage.
Every release should always have a unique release ID
Release cannot be mutated once it is created. Any change must create a new
release
The run stage should be kept to as few moving parts as possible
6. Processes
Execute the app as one or more stateless processes
6. Processes
The app is executed in the execution environment as one or more processes.
Twelve-factor processes are stateless and share-nothing. Any data that needs to
persist must be stored in a stateful backing service, typically a database.
The twelve-factor app never assumes that anything cached in memory or on disk
will be available on a future request or job
An app prefers to do this compiling during the build stage, rather than at runtime
Sticky sessions are a violation of twelve-factor
7. Port binding
Export services via port binding
7. Port binding
An app is completely self-contained
A web app exports HTTP as a service by binding to a port, and listening to
requests coming in on that port
The contract with the execution environment is binding to a port to serve requests
8. Concurrency
Scale out via the process model
8. Concurrency
Processes are a first class citizen
The share-nothing, horizontally partitionable nature of twelve-factor app processes
means that adding more concurrency is a simple and reliable operation
App processes should never daemonize or write PID files. Instead, rely on the
operating system’s process manager to manage output streams, respond to
crashed processes, and handle user-initiated restarts and shutdowns
9. Disposability
Maximize robustness with fast startup and graceful
shutdown
9. Disposability
App’s processes are disposable, meaning they can be started or stopped at a
moment’s notice
Processes should strive to minimize startup time.
Processes shut down gracefully when they receive a SIGTERM.
Processes should also be robust against sudden death
An app is architected to handle unexpected, non-graceful terminations.
10. Dev/prod parity
Keep development, staging, and production as
similar as possible
10. Dev/prod parity
An app is designed for continuous deployment by keeping the gap between
development and production small
Time between deploys take only hours
Code authors and code deployers can be the same people
Dev vs production environments should be as similar as possible
Developers resists the urge to use different backing services between
development and production
11. Logs
Treat logs as event streams
11. Logs
An app never concerns itself with routing or storage of its output stream.
It should not attempt to write to or manage logfiles. Instead, each running process
writes its event stream, unbuffered, to stdout.
During local development, the developer will view this stream in the foreground of
their terminal to observe the app’s behavior.
Production deploys, each process’ stream will be captured by the execution
environment and routed to one or more final destinations for viewing and
long-term archival. These archival destinations are not visible to or configurable by
the app, and instead are managed by the execution environment
12. Admin processes
Run admin/management tasks as one-off processes
12. Admin processes
One-off admin processes should be run in an identical environment as the regular
long-running processes of the app.
They should run against a release, using the same codebase and config as any
process run against that release.
Admin code must ship with application code to avoid synchronization issues.
Para leer
https://12factor.net/
https://medium.com/@kelseyhightower/12-fractured-apps-1080c73d481c#.o91yys
cpj (palabra de Kelsey)

Contenu connexe

Tendances

TFS Build - Continuous Integration
TFS Build - Continuous IntegrationTFS Build - Continuous Integration
TFS Build - Continuous IntegrationEsteban Garcia
 
Continuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentContinuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentChristopher Read
 
Ansible with Jenkins in a CI/CD Process
Ansible with Jenkins in a CI/CD ProcessAnsible with Jenkins in a CI/CD Process
Ansible with Jenkins in a CI/CD ProcessKhairul Zebua
 
Continuous integration using jenkins
Continuous integration using jenkinsContinuous integration using jenkins
Continuous integration using jenkinsVinay H G
 
Continuous Integration as a Way of Life
Continuous Integration as a Way of LifeContinuous Integration as a Way of Life
Continuous Integration as a Way of LifeMelissa Benua
 
Continuous integration
Continuous integrationContinuous integration
Continuous integrationamscanne
 
Continuous integration / deployment with Jenkins
Continuous integration / deployment with JenkinsContinuous integration / deployment with Jenkins
Continuous integration / deployment with Jenkinscherryhillco
 
Continuous integration - main principles
Continuous integration - main principlesContinuous integration - main principles
Continuous integration - main principlesLena Petsenchuk
 
Aiming for automatic updates - Drupal Dev Days Lisbon 2018
Aiming for automatic updates - Drupal Dev Days Lisbon 2018Aiming for automatic updates - Drupal Dev Days Lisbon 2018
Aiming for automatic updates - Drupal Dev Days Lisbon 2018hernanibf
 
SanDiego_DevOps_Meetup_9212016-v8
SanDiego_DevOps_Meetup_9212016-v8SanDiego_DevOps_Meetup_9212016-v8
SanDiego_DevOps_Meetup_9212016-v8Rajwinder Singh
 
Seminar continuous delivery 19092013
Seminar continuous delivery 19092013Seminar continuous delivery 19092013
Seminar continuous delivery 19092013Joris De Winne
 

Tendances (20)

CI with TFS
CI with TFSCI with TFS
CI with TFS
 
Devops | CICD Pipeline
Devops | CICD PipelineDevops | CICD Pipeline
Devops | CICD Pipeline
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
TFS Build - Continuous Integration
TFS Build - Continuous IntegrationTFS Build - Continuous Integration
TFS Build - Continuous Integration
 
Continuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentContinuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous Deployment
 
Ansible with Jenkins in a CI/CD Process
Ansible with Jenkins in a CI/CD ProcessAnsible with Jenkins in a CI/CD Process
Ansible with Jenkins in a CI/CD Process
 
Contineous integration
Contineous integrationContineous integration
Contineous integration
 
Continuous integration using jenkins
Continuous integration using jenkinsContinuous integration using jenkins
Continuous integration using jenkins
 
Continuous Integration as a Way of Life
Continuous Integration as a Way of LifeContinuous Integration as a Way of Life
Continuous Integration as a Way of Life
 
Jenkins
JenkinsJenkins
Jenkins
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Continuous integration / deployment with Jenkins
Continuous integration / deployment with JenkinsContinuous integration / deployment with Jenkins
Continuous integration / deployment with Jenkins
 
Dev ops using Jenkins
Dev ops using JenkinsDev ops using Jenkins
Dev ops using Jenkins
 
Continuous integration - main principles
Continuous integration - main principlesContinuous integration - main principles
Continuous integration - main principles
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Aiming for automatic updates - Drupal Dev Days Lisbon 2018
Aiming for automatic updates - Drupal Dev Days Lisbon 2018Aiming for automatic updates - Drupal Dev Days Lisbon 2018
Aiming for automatic updates - Drupal Dev Days Lisbon 2018
 
SanDiego_DevOps_Meetup_9212016-v8
SanDiego_DevOps_Meetup_9212016-v8SanDiego_DevOps_Meetup_9212016-v8
SanDiego_DevOps_Meetup_9212016-v8
 
Jenkins
JenkinsJenkins
Jenkins
 
Seminar continuous delivery 19092013
Seminar continuous delivery 19092013Seminar continuous delivery 19092013
Seminar continuous delivery 19092013
 
CD
CDCD
CD
 

En vedette

The Twelve Factor App
The Twelve Factor AppThe Twelve Factor App
The Twelve Factor AppPablo Fullana
 
Quantifying the Benefits of Cloud Foundry
Quantifying the Benefits of Cloud FoundryQuantifying the Benefits of Cloud Foundry
Quantifying the Benefits of Cloud FoundryAltoros
 
The Twelve-Factor App
The Twelve-Factor AppThe Twelve-Factor App
The Twelve-Factor AppSimon Vocella
 
The 12 Factor App
The 12 Factor AppThe 12 Factor App
The 12 Factor Apprudiyardley
 
Deploying Microservices to Cloud Foundry
Deploying Microservices to Cloud FoundryDeploying Microservices to Cloud Foundry
Deploying Microservices to Cloud FoundryMatt Stine
 
Cloud foundry architecture and deep dive
Cloud foundry architecture and deep diveCloud foundry architecture and deep dive
Cloud foundry architecture and deep diveAnimesh Singh
 
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)VMware Tanzu
 
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic RelationshipCloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic RelationshipMatt Stine
 

En vedette (8)

The Twelve Factor App
The Twelve Factor AppThe Twelve Factor App
The Twelve Factor App
 
Quantifying the Benefits of Cloud Foundry
Quantifying the Benefits of Cloud FoundryQuantifying the Benefits of Cloud Foundry
Quantifying the Benefits of Cloud Foundry
 
The Twelve-Factor App
The Twelve-Factor AppThe Twelve-Factor App
The Twelve-Factor App
 
The 12 Factor App
The 12 Factor AppThe 12 Factor App
The 12 Factor App
 
Deploying Microservices to Cloud Foundry
Deploying Microservices to Cloud FoundryDeploying Microservices to Cloud Foundry
Deploying Microservices to Cloud Foundry
 
Cloud foundry architecture and deep dive
Cloud foundry architecture and deep diveCloud foundry architecture and deep dive
Cloud foundry architecture and deep dive
 
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
Cloud Foundry Compared With Other PaaSes (Cloud Foundry Summit 2014)
 
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic RelationshipCloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
 

Similaire à Twelve factor apps

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 SolutionsKashif Ali Siddiqui
 
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...DigitalOcean
 
Multi platform application deployment with urban code deploy
Multi platform application deployment with urban code deployMulti platform application deployment with urban code deploy
Multi platform application deployment with urban code deploySaranga Tripathy
 
Twelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application ArchitectureTwelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application ArchitectureSigfred Balatan Jr.
 
Top 10 Best DevOps tools in 2020
Top 10 Best DevOps tools in 2020Top 10 Best DevOps tools in 2020
Top 10 Best DevOps tools in 2020prafulIQBusiness
 
The Twelve Factor Apps
The Twelve Factor AppsThe Twelve Factor Apps
The Twelve Factor Appstomi vanek
 
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...Jitendra Bafna
 
The Evolution from Agile to DevOps
The Evolution from Agile to DevOpsThe Evolution from Agile to DevOps
The Evolution from Agile to DevOpsXMPlify Tech
 
Introduction to Bluemix and Watson
Introduction to Bluemix and WatsonIntroduction to Bluemix and Watson
Introduction to Bluemix and WatsonJake Peyser
 
Twelve Factor App With Lagom
Twelve Factor App With LagomTwelve Factor App With Lagom
Twelve Factor App With LagomKnoldus Inc.
 
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...Simplilearn
 
Transform Digital Business with DevOps
Transform Digital Business with DevOpsTransform Digital Business with DevOps
Transform Digital Business with DevOpsDaniel Oh
 
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...Matt Ray
 
Webcast urbancodemobiltomainframe
Webcast urbancodemobiltomainframeWebcast urbancodemobiltomainframe
Webcast urbancodemobiltomainframeRosalind Radcliffe
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021NeerajKumar1965
 

Similaire à Twelve factor apps (20)

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
 
Hello cloud 6
Hello  cloud 6Hello  cloud 6
Hello cloud 6
 
12 factor apps
12 factor apps12 factor apps
12 factor apps
 
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...
 
Multi platform application deployment with urban code deploy
Multi platform application deployment with urban code deployMulti platform application deployment with urban code deploy
Multi platform application deployment with urban code deploy
 
Twelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application ArchitectureTwelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application Architecture
 
Top 10 Best DevOps tools in 2020
Top 10 Best DevOps tools in 2020Top 10 Best DevOps tools in 2020
Top 10 Best DevOps tools in 2020
 
The Twelve Factor Apps
The Twelve Factor AppsThe Twelve Factor Apps
The Twelve Factor Apps
 
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
 
The Evolution from Agile to DevOps
The Evolution from Agile to DevOpsThe Evolution from Agile to DevOps
The Evolution from Agile to DevOps
 
Introduction to Bluemix and Watson
Introduction to Bluemix and WatsonIntroduction to Bluemix and Watson
Introduction to Bluemix and Watson
 
Microservices
MicroservicesMicroservices
Microservices
 
12-Factor Apps
12-Factor Apps12-Factor Apps
12-Factor Apps
 
Twelve Factor App With Lagom
Twelve Factor App With LagomTwelve Factor App With Lagom
Twelve Factor App With Lagom
 
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
 
Transform Digital Business with DevOps
Transform Digital Business with DevOpsTransform Digital Business with DevOps
Transform Digital Business with DevOps
 
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...
DevOps Days Singapore 2018 Ignite - Bringing Your Applications into the Futur...
 
Webcast urbancodemobiltomainframe
Webcast urbancodemobiltomainframeWebcast urbancodemobiltomainframe
Webcast urbancodemobiltomainframe
 
Cc unit 5
Cc unit 5Cc unit 5
Cc unit 5
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021
 

Plus de Alea Soluciones, S.L.

Plus de Alea Soluciones, S.L. (8)

Boot process: BIOS vs UEFI
Boot process: BIOS vs UEFIBoot process: BIOS vs UEFI
Boot process: BIOS vs UEFI
 
JavaScript, qué hermoso eres
JavaScript, qué hermoso eresJavaScript, qué hermoso eres
JavaScript, qué hermoso eres
 
Introducción a sysdig
Introducción a sysdigIntroducción a sysdig
Introducción a sysdig
 
Tests funcionales con Geb
Tests funcionales con GebTests funcionales con Geb
Tests funcionales con Geb
 
Introduction to Connascence
Introduction to ConnascenceIntroduction to Connascence
Introduction to Connascence
 
Polymer 101
Polymer 101Polymer 101
Polymer 101
 
Presentación CAS 2016: Alineando valores y principios con prácticas técnicas
Presentación CAS 2016: Alineando valores y principios con prácticas técnicasPresentación CAS 2016: Alineando valores y principios con prácticas técnicas
Presentación CAS 2016: Alineando valores y principios con prácticas técnicas
 
Taller PyConEs 2016: Introducción a TDD
Taller PyConEs 2016: Introducción a TDDTaller PyConEs 2016: Introducción a TDD
Taller PyConEs 2016: Introducción a TDD
 

Dernier

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 

Dernier (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 

Twelve factor apps

  • 2. The twelve-factor app is a methodology for building software-as-a-service apps that
  • 3. ● Use declarative formats for setup automation, to minimize time and cost for new developers joining the project; ● Have a clean contract with the underlying operating system, offering maximum portability between execution environments; ● Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems administration; ● Minimize divergence between development and production, enabling continuous deployment for maximum agility; ● And can scale up without significant changes to tooling, architecture, or development practices.
  • 4. Background ● Inspired by developing and operating on the Heroku platform ● Tackle Organic growth of app ● Avoid software erosion ● Provide a shared vocabulary ● The format is inspired by Martin Fowler’s books Patterns of Enterprise Application Architecture and Refactoring
  • 6. 1. Codebase One codebase tracked in revision control, many deploys
  • 7. 1. Codebase A twelve-factor app is always tracked in a version control system. A codebase is any single repo (in a centralized revision control system like Subversion), or any set of repos who share a root commit (in a decentralized revision control system like Git). If there are multiple codebases, it’s not an app – it’s a distributed system. Multiple apps sharing the same code is a violation of twelve-factor. The solution here is to factor shared code into libraries which can be included through the dependency manager.
  • 8. 1. Codebase There is only one codebase per app. There might be many deploys of the app. A deploy is a running instance of the app. The codebase is the same across all deploys, although different versions may be active in each deploy.
  • 9. 2. Dependencies Explicitly declare and isolate dependencies
  • 10. 2. Dependencies A twelve-factor app never relies on implicit existence of system-wide packages. An app declares all dependencies, completely and exactly, via a dependency declaration manifest. An app uses a dependency isolation tool. Apps do not rely on the implicit existence of any system tools. Examples include shelling out to curl. If an app needs to shell out to a system tool, that tool should be vendored into the app
  • 11. 3. Configuration Store config in the environment
  • 12. 3. Configuration An app’s config is everything that is likely to vary between deploys An app stores its config in environment variables Env vars are easy to change between deploys without changing any code. Env vars are granular controls, each fully orthogonal to other env vars
  • 13. 4. Backing services Treat backing services as attached resources
  • 14. 4. Backing services A backing service is any service the app consumes over the network as part of its normal operation (DB, broker, object store, etc) The code for a twelve-factor app makes no distinction between local and third party services, both are attached resources, accessed via a URL or other locator/credentials stored in the config. The services should be swappable without code changes Each distinct backing service is a resource. Resources can be attached and detached to deploys at will.
  • 16. 5. Build, release, run Strictly separate build and run stages
  • 17. 5. Build, release, run A codebase is transformed into a (non-development) deploy: ● The build stage converts a code repo into an executable bundle known as a build. Using a version of the code at a commit specified by the deployment process, the build stage fetches vendors dependencies and compiles binaries and assets. ● The release stage takes the build and combines it with the deploy’s current config. The resulting release contains both the build and the config and is ready for immediate execution. ● The run stage (also known as “runtime”) runs the app in the execution environment, by launching some set of the app’s processes against a selected release.
  • 19. 5. Build, release, run The app uses strict separation between the build, release, and run stages It is impossible to make changes to the code at runtime, since there is no way to propagate those changes back to the build stage. Every release should always have a unique release ID Release cannot be mutated once it is created. Any change must create a new release The run stage should be kept to as few moving parts as possible
  • 20. 6. Processes Execute the app as one or more stateless processes
  • 21. 6. Processes The app is executed in the execution environment as one or more processes. Twelve-factor processes are stateless and share-nothing. Any data that needs to persist must be stored in a stateful backing service, typically a database. The twelve-factor app never assumes that anything cached in memory or on disk will be available on a future request or job An app prefers to do this compiling during the build stage, rather than at runtime Sticky sessions are a violation of twelve-factor
  • 22. 7. Port binding Export services via port binding
  • 23. 7. Port binding An app is completely self-contained A web app exports HTTP as a service by binding to a port, and listening to requests coming in on that port The contract with the execution environment is binding to a port to serve requests
  • 24. 8. Concurrency Scale out via the process model
  • 25. 8. Concurrency Processes are a first class citizen The share-nothing, horizontally partitionable nature of twelve-factor app processes means that adding more concurrency is a simple and reliable operation App processes should never daemonize or write PID files. Instead, rely on the operating system’s process manager to manage output streams, respond to crashed processes, and handle user-initiated restarts and shutdowns
  • 26. 9. Disposability Maximize robustness with fast startup and graceful shutdown
  • 27. 9. Disposability App’s processes are disposable, meaning they can be started or stopped at a moment’s notice Processes should strive to minimize startup time. Processes shut down gracefully when they receive a SIGTERM. Processes should also be robust against sudden death An app is architected to handle unexpected, non-graceful terminations.
  • 28. 10. Dev/prod parity Keep development, staging, and production as similar as possible
  • 29. 10. Dev/prod parity An app is designed for continuous deployment by keeping the gap between development and production small Time between deploys take only hours Code authors and code deployers can be the same people Dev vs production environments should be as similar as possible Developers resists the urge to use different backing services between development and production
  • 30. 11. Logs Treat logs as event streams
  • 31. 11. Logs An app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to stdout. During local development, the developer will view this stream in the foreground of their terminal to observe the app’s behavior. Production deploys, each process’ stream will be captured by the execution environment and routed to one or more final destinations for viewing and long-term archival. These archival destinations are not visible to or configurable by the app, and instead are managed by the execution environment
  • 32. 12. Admin processes Run admin/management tasks as one-off processes
  • 33. 12. Admin processes One-off admin processes should be run in an identical environment as the regular long-running processes of the app. They should run against a release, using the same codebase and config as any process run against that release. Admin code must ship with application code to avoid synchronization issues.