SlideShare a Scribd company logo
1 of 14
Twelve Factor App
Tomasz Skręt
I. Codebase
• One repository - GIT :)
• One application per repository
• Extract shared code into
libraries
• Running instance - deploy
Tomasz Skręt - Twelve Factor App 2
II. Dependencies
● Use packaging system
● Isolate dependencies
● Do not rely on system tools
● Installing dependencies
should be simple, one
command process
Tomasz Skręt - Twelve Factor App 3
III. Config
• Store config in environment
• Each deploy has own config
• Do not checkout into repository
• Do not group config values as a
environments
Tomasz Skręt - Twelve Factor App 4
IV. Backing Services
Attached resources
• Databases
• File storage
• Cache
• Queue
• APIs
Tomasz Skręt - Twelve Factor App 5
V. Build, release, run
• build - checkout codebase,
install dependencies, run tests,
produce artifact
• release - combine build artifact
with environment config
• run - run application processes
Every release have version
Tomasz Skręt - Twelve Factor App 6
3 stages:
VI. Processes
Tomasz Skręt - Twelve Factor App 7
stateless
share nothing
use backing services
VII. Port binding
• expose application by binding to port
• one twelve factor app can become
backing service for another
• in PHP to expose HTTP service, we
can use nginx or haproxy
Tomasz Skręt - Twelve Factor App 8
VIII. Concurrency
Tomasz Skręt - Twelve Factor App 9
scale by creating new processes
don’t write PID files - use ex. upstart, systemd, foreman
IX. Disposability
• applications are disposable - easy to scale, change configuration, deploy
new version
• fast start
• gracefully shutdown
Tomasz Skręt - Twelve Factor App 10
X. Dev/prod parity
• environments should be similar
to production as much as
possible
• keep time gap small
• environment should be setup
fast and easy
• backing services can be
changed to another, ex. to
simplify development process
Tomasz Skręt - Twelve Factor App 11
XI. Logs
• Treat logs as event streams
• twelve-factor app never
concerns itself with routing or
storage of its output stream
• logs are collected from
application and all backing
services
Tomasz Skręt - Twelve Factor App 12
XII. Admin processes
• one-off process
• should run in identical environment - run the same codebase and
config as application - use release
• can be script, committed to repo
• REPL console
Tomasz Skręt - Twelve Factor App 13
Thank you for watching!
Questions?

More Related Content

What's hot

How to Adopt Infrastructure as Code
How to Adopt Infrastructure as CodeHow to Adopt Infrastructure as Code
How to Adopt Infrastructure as Code
NGINX, Inc.
 
OpenStack in Action 4! Vincent Untz - Running multiple hypervisors in your Op...
OpenStack in Action 4! Vincent Untz - Running multiple hypervisors in your Op...OpenStack in Action 4! Vincent Untz - Running multiple hypervisors in your Op...
OpenStack in Action 4! Vincent Untz - Running multiple hypervisors in your Op...
eNovance
 

What's hot (20)

OpenNebulaConf2018 - Hybrid Clouds: Dancing with "Automated" Virtual Machines...
OpenNebulaConf2018 - Hybrid Clouds: Dancing with "Automated" Virtual Machines...OpenNebulaConf2018 - Hybrid Clouds: Dancing with "Automated" Virtual Machines...
OpenNebulaConf2018 - Hybrid Clouds: Dancing with "Automated" Virtual Machines...
 
Support of containerized workloads in ONAP
Support of containerized workloads in ONAPSupport of containerized workloads in ONAP
Support of containerized workloads in ONAP
 
OpenStack reliability metrics
OpenStack reliability metricsOpenStack reliability metrics
OpenStack reliability metrics
 
Logs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK StackLogs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK Stack
 
OSDC 2018 | Self Hosted bare Metal Kubernetes for SMEs by Thomas Hoppe
OSDC 2018 | Self Hosted bare Metal Kubernetes for SMEs by Thomas HoppeOSDC 2018 | Self Hosted bare Metal Kubernetes for SMEs by Thomas Hoppe
OSDC 2018 | Self Hosted bare Metal Kubernetes for SMEs by Thomas Hoppe
 
Building a universal search interface for the Cloud
Building a universal search interface for the CloudBuilding a universal search interface for the Cloud
Building a universal search interface for the Cloud
 
Data Center to Cloud
Data Center to CloudData Center to Cloud
Data Center to Cloud
 
TechTalk - Building Serverless Applications with IBM Bluemix
TechTalk - Building Serverless Applications with IBM BluemixTechTalk - Building Serverless Applications with IBM Bluemix
TechTalk - Building Serverless Applications with IBM Bluemix
 
ELK - Optimizations & Updates
ELK - Optimizations & UpdatesELK - Optimizations & Updates
ELK - Optimizations & Updates
 
Monitoring Docker Application in Production
Monitoring Docker Application in ProductionMonitoring Docker Application in Production
Monitoring Docker Application in Production
 
How to Adopt Infrastructure as Code
How to Adopt Infrastructure as CodeHow to Adopt Infrastructure as Code
How to Adopt Infrastructure as Code
 
OpenStack in Action 4! Vincent Untz - Running multiple hypervisors in your Op...
OpenStack in Action 4! Vincent Untz - Running multiple hypervisors in your Op...OpenStack in Action 4! Vincent Untz - Running multiple hypervisors in your Op...
OpenStack in Action 4! Vincent Untz - Running multiple hypervisors in your Op...
 
Deploying OpenStack Services with Linux Containers - Brisbane OpenStack Meetu...
Deploying OpenStack Services with Linux Containers - Brisbane OpenStack Meetu...Deploying OpenStack Services with Linux Containers - Brisbane OpenStack Meetu...
Deploying OpenStack Services with Linux Containers - Brisbane OpenStack Meetu...
 
Cloud Native User Group: Prometheus Day 2
Cloud Native User Group:  Prometheus Day 2Cloud Native User Group:  Prometheus Day 2
Cloud Native User Group: Prometheus Day 2
 
Modern Monitoring - SysAdminDay 2017
Modern Monitoring - SysAdminDay 2017Modern Monitoring - SysAdminDay 2017
Modern Monitoring - SysAdminDay 2017
 
Launching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT ProjectsLaunching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT Projects
 
Code lifecycle on the Acquia Cloud Platform
Code lifecycle on the Acquia Cloud PlatformCode lifecycle on the Acquia Cloud Platform
Code lifecycle on the Acquia Cloud Platform
 
Compass first meetup
Compass first meetupCompass first meetup
Compass first meetup
 
Nova Updates - Liberty Edition
Nova Updates - Liberty EditionNova Updates - Liberty Edition
Nova Updates - Liberty Edition
 
OpenStack: Changing the Face of Service Delivery
OpenStack: Changing the Face of Service DeliveryOpenStack: Changing the Face of Service Delivery
OpenStack: Changing the Face of Service Delivery
 

Viewers also liked

Viewers also liked (20)

12 factor app. Melhor com Docker
12 factor app. Melhor com Docker12 factor app. Melhor com Docker
12 factor app. Melhor com Docker
 
Lightning talk: 12 Factor Containers
Lightning talk: 12 Factor ContainersLightning talk: 12 Factor Containers
Lightning talk: 12 Factor Containers
 
12-factor applications using WAS Liberty, IBM Bluemix, and Docker
12-factor applications using WAS Liberty, IBM Bluemix, and Docker12-factor applications using WAS Liberty, IBM Bluemix, and Docker
12-factor applications using WAS Liberty, IBM Bluemix, and Docker
 
12 factor app
12 factor app12 factor app
12 factor app
 
EMC World 2016 12 Factor Apps FTW
EMC World 2016 12 Factor Apps FTWEMC World 2016 12 Factor Apps FTW
EMC World 2016 12 Factor Apps FTW
 
The Twelve Factor App - Pivotal Tracker
The Twelve Factor App - Pivotal TrackerThe Twelve Factor App - Pivotal Tracker
The Twelve Factor App - Pivotal Tracker
 
The Twelve-Factor App
The Twelve-Factor AppThe Twelve-Factor App
The Twelve-Factor App
 
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor Apps
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor AppsLibrato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor Apps
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor Apps
 
12-Factor App
12-Factor App12-Factor App
12-Factor App
 
JavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor AppJavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor App
 
The 12 Factor App
The 12 Factor AppThe 12 Factor App
The 12 Factor App
 
12 Factor App from Docker's Point of View
12 Factor App from Docker's Point of View12 Factor App from Docker's Point of View
12 Factor App from Docker's Point of View
 
12 factor app an introduction
12 factor app an introduction12 factor app an introduction
12 factor app an introduction
 
The History of Pets vs. Cattle ... And Using It Properly
The History of Pets vs. Cattle ... And Using It ProperlyThe History of Pets vs. Cattle ... And Using It Properly
The History of Pets vs. Cattle ... And Using It Properly
 
Cloud Native Applications Maturity Model
Cloud Native Applications Maturity ModelCloud Native Applications Maturity Model
Cloud Native Applications Maturity Model
 
The Need of Cloud-Native Application
The Need of Cloud-Native ApplicationThe Need of Cloud-Native Application
The Need of Cloud-Native Application
 
Micro services, reactive manifesto and 12-factors
Micro services, reactive manifesto and 12-factorsMicro services, reactive manifesto and 12-factors
Micro services, reactive manifesto and 12-factors
 
Patterns of Cloud Native Architecture
Patterns of Cloud Native ArchitecturePatterns of Cloud Native Architecture
Patterns of Cloud Native Architecture
 
ClouNS - A Cloud-native Application Reference Model for Enterprise Architects
ClouNS - A Cloud-native Application Reference Model for Enterprise ArchitectsClouNS - A Cloud-native Application Reference Model for Enterprise Architects
ClouNS - A Cloud-native Application Reference Model for Enterprise Architects
 
Pets vs. Cattle: The Elastic Cloud Story
Pets vs. Cattle: The Elastic Cloud StoryPets vs. Cattle: The Elastic Cloud Story
Pets vs. Cattle: The Elastic Cloud Story
 

Similar to Twelve Factor App @ PHPCon 2015

Application Virtualization overview - BayCUG
Application Virtualization overview - BayCUGApplication Virtualization overview - BayCUG
Application Virtualization overview - BayCUG
Denis Gundarev
 

Similar to Twelve Factor App @ PHPCon 2015 (20)

12 Factor App Methodology
12 Factor App Methodology12 Factor App Methodology
12 Factor App Methodology
 
Twelve-Factor application pattern with Spring Framework
Twelve-Factor application pattern with Spring FrameworkTwelve-Factor application pattern with Spring Framework
Twelve-Factor application pattern with Spring Framework
 
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
 
Twelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application ArchitectureTwelve-Factor App: Software Application Architecture
Twelve-Factor App: Software Application Architecture
 
Migrating Java EE applications to IBM Bluemix Platform-as-a-Service
Migrating Java EE applications to IBM Bluemix Platform-as-a-ServiceMigrating Java EE applications to IBM Bluemix Platform-as-a-Service
Migrating Java EE applications to IBM Bluemix Platform-as-a-Service
 
12-Factor Apps
12-Factor Apps12-Factor Apps
12-Factor Apps
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor app
 
Breaking the Monolith
Breaking the MonolithBreaking the Monolith
Breaking the Monolith
 
Dockerize All The Things
Dockerize All The ThingsDockerize All The Things
Dockerize All The Things
 
Kube con china_2019_7 missing factors for your production-quality 12-factor apps
Kube con china_2019_7 missing factors for your production-quality 12-factor appsKube con china_2019_7 missing factors for your production-quality 12-factor apps
Kube con china_2019_7 missing factors for your production-quality 12-factor apps
 
Webinar: OpenStack Accelerates Software Development
Webinar: OpenStack Accelerates Software DevelopmentWebinar: OpenStack Accelerates Software Development
Webinar: OpenStack Accelerates Software Development
 
Application Virtualization overview - BayCUG
Application Virtualization overview - BayCUGApplication Virtualization overview - BayCUG
Application Virtualization overview - BayCUG
 
Meetup Openshift Geneva 03/10
Meetup Openshift Geneva 03/10Meetup Openshift Geneva 03/10
Meetup Openshift Geneva 03/10
 
Microservices
MicroservicesMicroservices
Microservices
 
Migrate Heroku & OpenShift Applications to IBM BlueMix
Migrate Heroku & OpenShift Applications to IBM BlueMixMigrate Heroku & OpenShift Applications to IBM BlueMix
Migrate Heroku & OpenShift Applications to IBM BlueMix
 
Pywps
PywpsPywps
Pywps
 
PyWPS-4.0.0
PyWPS-4.0.0PyWPS-4.0.0
PyWPS-4.0.0
 
What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017
 
Introduction to Node.js by Vinothini B
Introduction to Node.js by Vinothini BIntroduction to Node.js by Vinothini B
Introduction to Node.js by Vinothini B
 
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 

Twelve Factor App @ PHPCon 2015

  • 2. I. Codebase • One repository - GIT :) • One application per repository • Extract shared code into libraries • Running instance - deploy Tomasz Skręt - Twelve Factor App 2
  • 3. II. Dependencies ● Use packaging system ● Isolate dependencies ● Do not rely on system tools ● Installing dependencies should be simple, one command process Tomasz Skręt - Twelve Factor App 3
  • 4. III. Config • Store config in environment • Each deploy has own config • Do not checkout into repository • Do not group config values as a environments Tomasz Skręt - Twelve Factor App 4
  • 5. IV. Backing Services Attached resources • Databases • File storage • Cache • Queue • APIs Tomasz Skręt - Twelve Factor App 5
  • 6. V. Build, release, run • build - checkout codebase, install dependencies, run tests, produce artifact • release - combine build artifact with environment config • run - run application processes Every release have version Tomasz Skręt - Twelve Factor App 6 3 stages:
  • 7. VI. Processes Tomasz Skręt - Twelve Factor App 7 stateless share nothing use backing services
  • 8. VII. Port binding • expose application by binding to port • one twelve factor app can become backing service for another • in PHP to expose HTTP service, we can use nginx or haproxy Tomasz Skręt - Twelve Factor App 8
  • 9. VIII. Concurrency Tomasz Skręt - Twelve Factor App 9 scale by creating new processes don’t write PID files - use ex. upstart, systemd, foreman
  • 10. IX. Disposability • applications are disposable - easy to scale, change configuration, deploy new version • fast start • gracefully shutdown Tomasz Skręt - Twelve Factor App 10
  • 11. X. Dev/prod parity • environments should be similar to production as much as possible • keep time gap small • environment should be setup fast and easy • backing services can be changed to another, ex. to simplify development process Tomasz Skręt - Twelve Factor App 11
  • 12. XI. Logs • Treat logs as event streams • twelve-factor app never concerns itself with routing or storage of its output stream • logs are collected from application and all backing services Tomasz Skręt - Twelve Factor App 12
  • 13. XII. Admin processes • one-off process • should run in identical environment - run the same codebase and config as application - use release • can be script, committed to repo • REPL console Tomasz Skręt - Twelve Factor App 13
  • 14. Thank you for watching! Questions?