SlideShare a Scribd company logo
Presented By: Girish Chandra Bharti (Sr. Software Consultant @ Knoldus)
Twelve Factor App with
lagom
Agenda
01 Introduction of twelve factor app
02 Explanation of individual
principle
03 Question and answer
session
04 References
60
6
Twelve factor app principle
●Methodology for building software as a
service application and these best practices
are designed to enable applications to be built
with portability and resilience when
deployed to the web.
●It was drafted by developers at Heroku and
was first presented by Adam Wiggins circa
2011.
Twelve factor app principle
● I. Codebase
● II. Dependencies
● III. Config
● IV. Backing services
● V. Build, release, run
● VI. Processes
● VII. Port binding
● VIII. Concurrency
● IX. Disposability
● X. Dev/prod parity
● XI. Logs
● XII. Admin processes
The 12 factors
I. Codebase
● Revision control in plase.
● If there are multiple codebases, it’s not an app – it’s a distributed
system.
● Each component in a distributed system is an app, and each can
individually comply with twelve-factor.
● 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.
One codebase tracked in revision control, many deploys
I. Codebase
● Lagom follows this principle partially as it allows
single codebase for application but also multiple
services sharing the same codebase.
● That can be avoided by shared libraries.
Lagom with single codebase
II. Dependencies
● It declares all dependencies, completely and
exactly, via a dependency declaration manifest
● Twelve-factor apps also do not rely on the
implicit existence of any system tools (eg curl).
Explicitly declare and isolate dependencies
II. Dependencies
● Lagom follows this principle by allowing explicit
dependency declaration using build.sbt (scala).
Lagom dependency handling
III. Config
● Configurables:
- Resource handles to the database, Memcached, and other
backing services
- Credentials to external services such as Amazon S3 or Twitter
- Per-deploy values such as the canonical hostname for the
deploy
● Storing config as constants in the code is a violation
of twelve-factor
Store config in the environment
IV. Backing services
● A backing service is any service the app consumes over the network
as part of its normal operation (mysql, couchDB, kafka)
● The code for a twelve-factor app makes no distinction between
local and third party services.
● To the app, both are attached resources, accessed via a URL or other
locator/credentials stored in the config.
● A deploy of the twelve-factor app should be able to swap out a local
MySQL database with one managed by a third party (such as Amazon
RDS) without any changes to the app’s code.
Treat backing services as attached resources
V. Build, release, run
● The twelve-factor app uses strict separation
between the build, release, and run stages.
Strictly separate build and run stages
V. Build, release, run
● Lagom app deployment:
1. Build (Bundle)
2. Config (RP Tool)
3 Deployment (Marathon)
Lagom supports for build, release, and run stages.
VI. 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
● Sticky sessions (user session) are a violation of twelve-factor
and should never be used or relied upon.
Execute the app as one or more stateless processes
VI. Processes
● Lagom supports event sourcing to handle stateless processes
By writing event into third party database like Cassandra
(by default)
● Distributed pub-sub
● CRDTS (Conflict-free replicated data type for future)
Process model of lagom
VII. Port binding
● Port-binding approach means that one app can become the
backing service for another app, by providing the URL to the
backing app as a resource handle in the config for the
consuming app.
● The twelve-factor app is completely self-contained and does
not rely on runtime injection of a webserver into the execution
environment to create a web-facing service
● The web app exports HTTP as a service by binding to a port,
and listening to requests coming in on that port.
Export services via port binding
● Lagom allows to create microservices and let other services
consume them using port bindings.
● To access them from outside we can make the rest
rest calls
VII. Port binding
Port binding in lagom
● Using this model, the developer can architect their app to
Handle diverse workloads by assigning each type of work
to a process type.
● For example, HTTP requests can be handled by a web
process, and long-running background tasks handled
by a worker process
VIII. Concurrency
Scale out via the process model
● Supports CQRS for handling reads and writes
● Supports different dispatcher dispatchers
and execution contexts
VIII. Concurrency
Scale out via the process model
● The twelve-factor app processes are disposable,
meaning they can be started or stopped at a
moment’s notice.
● Processes should strive to minimize startup time.
● Processes shutdown gracefully when they receive
a shutdown signal from the process manager
IX. Disposability
Maximize robustness with fast startup and graceful shutdown
● Supports fast startup while deploying the application however
build takes time to finish (On local might take time to start the
application)
● Support graceful shutdown for rest apis and background processes
● Supports graceful shutdown for persistence entities
● User defined actors can be designed to support graceful shutdown
IX. Disposability
Fast startup and graceful shutdown in lagom
● The twelve-factor app is designed for continuous
deployment by keeping the gap between
development and production small.
● Recommendations:
- Make the time gap small
- Make the personnel gap small
- Make the tools gap small
X. Dev/prod parity
Keep development, staging, and production as similar as possible
● Logs are the stream of aggregated, time-ordered events collected
from the output streams of all running processes and backing services
Advantages:
● Finding specific events in the past.
● Large-scale graphing of trends
● Active alerting
XI. Logs
Treat logs as event streams
● Additional administrative or maintenance tasks for the app:
- Running database migrations
- Running a console
- Running one-time scripts
● One-off admin processes should run in an identical
environment as the regular long-running processes of the app
XII. Admin processes
Run admin/management tasks as one-off processes
References
https://12factor.net
https://www.lagomframework.com/
https://blog.knoldus.com/the-twelve-factor-app-principle-with-lagom-framework/
Thank You !

More Related Content

What's hot

12 factor app
12 factor app12 factor app
12 factor app
Dmytro Panin
 
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
VMware Tanzu
 
Orchestrating Cloud-Native and Traditional Application Architectures
Orchestrating Cloud-Native and Traditional Application ArchitecturesOrchestrating Cloud-Native and Traditional Application Architectures
Orchestrating Cloud-Native and Traditional Application Architectures
Apprenda
 
The 12 Factors for Building Cloud-Native Software
The 12 Factors for Building Cloud-Native SoftwareThe 12 Factors for Building Cloud-Native Software
The 12 Factors for Building Cloud-Native Software
VMware Tanzu
 
Mule soft meetup_chandigarh_#7_25_sept_2021
Mule soft meetup_chandigarh_#7_25_sept_2021Mule soft meetup_chandigarh_#7_25_sept_2021
Mule soft meetup_chandigarh_#7_25_sept_2021
Lalit Panwar
 
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with SpringBuilding Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
Kenny Bastani
 
[Konveyor] migrate and modernize your application portfolio to kubernetes wit...
[Konveyor] migrate and modernize your application portfolio to kubernetes wit...[Konveyor] migrate and modernize your application portfolio to kubernetes wit...
[Konveyor] migrate and modernize your application portfolio to kubernetes wit...
Konveyor Community
 
Cloud Native Infrastructure Automation
Cloud Native Infrastructure AutomationCloud Native Infrastructure Automation
Cloud Native Infrastructure Automation
VMware Tanzu
 
Sicurezza integrate nella tua piattaforma Cloud-Native con VMware NSX (Pivota...
Sicurezza integrate nella tua piattaforma Cloud-Native con VMware NSX (Pivota...Sicurezza integrate nella tua piattaforma Cloud-Native con VMware NSX (Pivota...
Sicurezza integrate nella tua piattaforma Cloud-Native con VMware NSX (Pivota...
VMware Tanzu
 
Multi-cloud Container Management for vRealize Automation
Multi-cloud Container Management for vRealize AutomationMulti-cloud Container Management for vRealize Automation
Multi-cloud Container Management for vRealize Automation
Jim Bugwadia
 
MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021
Nicholas Bowman
 
Lo Scenario Cloud-Native (Pivotal Cloud-Native Workshop: Milan)
Lo Scenario Cloud-Native (Pivotal Cloud-Native Workshop: Milan)Lo Scenario Cloud-Native (Pivotal Cloud-Native Workshop: Milan)
Lo Scenario Cloud-Native (Pivotal Cloud-Native Workshop: Milan)
VMware Tanzu
 
MuleSoft Meetup #2 in Kyiv, Ukraine - What is special about MuleSoft Catalyst™?
MuleSoft Meetup #2 in Kyiv, Ukraine - What is special about MuleSoft Catalyst™?MuleSoft Meetup #2 in Kyiv, Ukraine - What is special about MuleSoft Catalyst™?
MuleSoft Meetup #2 in Kyiv, Ukraine - What is special about MuleSoft Catalyst™?
Maksym Dovgopolyi, PMP
 
Cloud Event Driven Architectures with Spring Cloud Stream 2.0 - Oleg Zhurakousky
Cloud Event Driven Architectures with Spring Cloud Stream 2.0 - Oleg ZhurakouskyCloud Event Driven Architectures with Spring Cloud Stream 2.0 - Oleg Zhurakousky
Cloud Event Driven Architectures with Spring Cloud Stream 2.0 - Oleg Zhurakousky
VMware Tanzu
 
The Cloud Native Journey
The Cloud Native JourneyThe Cloud Native Journey
The Cloud Native Journey
VMware Tanzu
 
MuleSoft Meetup Roma - Processi di Automazione su CloudHub
MuleSoft Meetup Roma - Processi di Automazione su CloudHubMuleSoft Meetup Roma - Processi di Automazione su CloudHub
MuleSoft Meetup Roma - Processi di Automazione su CloudHub
Alfonso Martino
 
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
VMware Tanzu
 
Migrating from oracle soa suite to microservices on kubernetes
Migrating from oracle soa suite to microservices on kubernetesMigrating from oracle soa suite to microservices on kubernetes
Migrating from oracle soa suite to microservices on kubernetes
Konveyor Community
 
Pivotal Cloud Foundry 1.10: First Look - Windows at Scale, Network Isolation
Pivotal Cloud Foundry 1.10: First Look - Windows at Scale, Network IsolationPivotal Cloud Foundry 1.10: First Look - Windows at Scale, Network Isolation
Pivotal Cloud Foundry 1.10: First Look - Windows at Scale, Network Isolation
VMware Tanzu
 
Modern application development with heroku
Modern application development with herokuModern application development with heroku
Modern application development with heroku
Siva Rama Krishna Chunduru
 

What's hot (20)

12 factor app
12 factor app12 factor app
12 factor app
 
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
Pivotal Container Service il modo più semplice per gestire Kubernetes in azie...
 
Orchestrating Cloud-Native and Traditional Application Architectures
Orchestrating Cloud-Native and Traditional Application ArchitecturesOrchestrating Cloud-Native and Traditional Application Architectures
Orchestrating Cloud-Native and Traditional Application Architectures
 
The 12 Factors for Building Cloud-Native Software
The 12 Factors for Building Cloud-Native SoftwareThe 12 Factors for Building Cloud-Native Software
The 12 Factors for Building Cloud-Native Software
 
Mule soft meetup_chandigarh_#7_25_sept_2021
Mule soft meetup_chandigarh_#7_25_sept_2021Mule soft meetup_chandigarh_#7_25_sept_2021
Mule soft meetup_chandigarh_#7_25_sept_2021
 
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with SpringBuilding Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
 
[Konveyor] migrate and modernize your application portfolio to kubernetes wit...
[Konveyor] migrate and modernize your application portfolio to kubernetes wit...[Konveyor] migrate and modernize your application portfolio to kubernetes wit...
[Konveyor] migrate and modernize your application portfolio to kubernetes wit...
 
Cloud Native Infrastructure Automation
Cloud Native Infrastructure AutomationCloud Native Infrastructure Automation
Cloud Native Infrastructure Automation
 
Sicurezza integrate nella tua piattaforma Cloud-Native con VMware NSX (Pivota...
Sicurezza integrate nella tua piattaforma Cloud-Native con VMware NSX (Pivota...Sicurezza integrate nella tua piattaforma Cloud-Native con VMware NSX (Pivota...
Sicurezza integrate nella tua piattaforma Cloud-Native con VMware NSX (Pivota...
 
Multi-cloud Container Management for vRealize Automation
Multi-cloud Container Management for vRealize AutomationMulti-cloud Container Management for vRealize Automation
Multi-cloud Container Management for vRealize Automation
 
MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021
 
Lo Scenario Cloud-Native (Pivotal Cloud-Native Workshop: Milan)
Lo Scenario Cloud-Native (Pivotal Cloud-Native Workshop: Milan)Lo Scenario Cloud-Native (Pivotal Cloud-Native Workshop: Milan)
Lo Scenario Cloud-Native (Pivotal Cloud-Native Workshop: Milan)
 
MuleSoft Meetup #2 in Kyiv, Ukraine - What is special about MuleSoft Catalyst™?
MuleSoft Meetup #2 in Kyiv, Ukraine - What is special about MuleSoft Catalyst™?MuleSoft Meetup #2 in Kyiv, Ukraine - What is special about MuleSoft Catalyst™?
MuleSoft Meetup #2 in Kyiv, Ukraine - What is special about MuleSoft Catalyst™?
 
Cloud Event Driven Architectures with Spring Cloud Stream 2.0 - Oleg Zhurakousky
Cloud Event Driven Architectures with Spring Cloud Stream 2.0 - Oleg ZhurakouskyCloud Event Driven Architectures with Spring Cloud Stream 2.0 - Oleg Zhurakousky
Cloud Event Driven Architectures with Spring Cloud Stream 2.0 - Oleg Zhurakousky
 
The Cloud Native Journey
The Cloud Native JourneyThe Cloud Native Journey
The Cloud Native Journey
 
MuleSoft Meetup Roma - Processi di Automazione su CloudHub
MuleSoft Meetup Roma - Processi di Automazione su CloudHubMuleSoft Meetup Roma - Processi di Automazione su CloudHub
MuleSoft Meetup Roma - Processi di Automazione su CloudHub
 
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
 
Migrating from oracle soa suite to microservices on kubernetes
Migrating from oracle soa suite to microservices on kubernetesMigrating from oracle soa suite to microservices on kubernetes
Migrating from oracle soa suite to microservices on kubernetes
 
Pivotal Cloud Foundry 1.10: First Look - Windows at Scale, Network Isolation
Pivotal Cloud Foundry 1.10: First Look - Windows at Scale, Network IsolationPivotal Cloud Foundry 1.10: First Look - Windows at Scale, Network Isolation
Pivotal Cloud Foundry 1.10: First Look - Windows at Scale, Network Isolation
 
Modern application development with heroku
Modern application development with herokuModern application development with heroku
Modern application development with heroku
 

Similar to Twelve Factor App With Lagom

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
dinkar thakur
 
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
 
Breaking the Monolith
Breaking the MonolithBreaking the Monolith
Breaking the Monolith
VMware Tanzu
 
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
NeerajKumar1965
 
12-Factor Apps
12-Factor Apps12-Factor Apps
Information on Cloud-native Applications
Information on Cloud-native ApplicationsInformation on Cloud-native Applications
Information on Cloud-native Applications
HTS Hosting
 
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
Jitendra Bafna
 
Adopting the Cloud
Adopting the CloudAdopting the Cloud
Adopting the Cloud
Tapio Rautonen
 
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
Pablo Fullana
 
What serverless means for enterprise apps
What serverless means for enterprise appsWhat serverless means for enterprise apps
What serverless means for enterprise apps
Sumit Sarkar
 
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
Jitendra Bafna
 
A09 - Microservices.pptx
A09 - Microservices.pptxA09 - Microservices.pptx
A09 - Microservices.pptx
CrispinBrown2
 
08 hopex v next service fabric
08 hopex v next   service fabric08 hopex v next   service fabric
08 hopex v next service fabric
Michel Bruchet
 
Microservices
MicroservicesMicroservices
Microservices
Abdelrahman Badreldeen
 
AppDev with Microservices
AppDev with MicroservicesAppDev with Microservices
AppDev with Microservices
Rishabh Dugar
 
Service Mesh and Serverless Chatbots with Linkerd, K8s and OpenFaaS
Service Mesh and Serverless Chatbots with Linkerd, K8s and OpenFaaSService Mesh and Serverless Chatbots with Linkerd, K8s and OpenFaaS
Service Mesh and Serverless Chatbots with Linkerd, K8s and OpenFaaS
Software Guru
 
Using IBM DataPower for rapid security and application integration with an op...
Using IBM DataPower for rapid security and application integration with an op...Using IBM DataPower for rapid security and application integration with an op...
Using IBM DataPower for rapid security and application integration with an op...
Gennadiy Civil
 
Microservice Workshop Hands On
Microservice Workshop Hands On Microservice Workshop Hands On
Microservice Workshop Hands On
Ram G Suri
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2
 

Similar to Twelve Factor App With Lagom (20)

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
 
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...
 
Breaking the Monolith
Breaking the MonolithBreaking the Monolith
Breaking the Monolith
 
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
 
12-Factor Apps
12-Factor Apps12-Factor Apps
12-Factor Apps
 
Information on Cloud-native Applications
Information on Cloud-native ApplicationsInformation on Cloud-native Applications
Information on Cloud-native Applications
 
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
 
Adopting the Cloud
Adopting the CloudAdopting the Cloud
Adopting the Cloud
 
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
 
What serverless means for enterprise apps
What serverless means for enterprise appsWhat serverless means for enterprise apps
What serverless means for enterprise apps
 
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
 
A09 - Microservices.pptx
A09 - Microservices.pptxA09 - Microservices.pptx
A09 - Microservices.pptx
 
08 hopex v next service fabric
08 hopex v next   service fabric08 hopex v next   service fabric
08 hopex v next service fabric
 
Microservices
MicroservicesMicroservices
Microservices
 
AppDev with Microservices
AppDev with MicroservicesAppDev with Microservices
AppDev with Microservices
 
Service Mesh and Serverless Chatbots with Linkerd, K8s and OpenFaaS
Service Mesh and Serverless Chatbots with Linkerd, K8s and OpenFaaSService Mesh and Serverless Chatbots with Linkerd, K8s and OpenFaaS
Service Mesh and Serverless Chatbots with Linkerd, K8s and OpenFaaS
 
Using IBM DataPower for rapid security and application integration with an op...
Using IBM DataPower for rapid security and application integration with an op...Using IBM DataPower for rapid security and application integration with an op...
Using IBM DataPower for rapid security and application integration with an op...
 
Microservice Workshop Hands On
Microservice Workshop Hands On Microservice Workshop Hands On
Microservice Workshop Hands On
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 

More from Knoldus Inc.

Terratest - Automation testing of infrastructure
Terratest - Automation testing of infrastructureTerratest - Automation testing of infrastructure
Terratest - Automation testing of infrastructure
Knoldus Inc.
 
Getting Started with Apache Spark (Scala)
Getting Started with Apache Spark (Scala)Getting Started with Apache Spark (Scala)
Getting Started with Apache Spark (Scala)
Knoldus Inc.
 
Secure practices with dot net services.pptx
Secure practices with dot net services.pptxSecure practices with dot net services.pptx
Secure practices with dot net services.pptx
Knoldus Inc.
 
Distributed Cache with dot microservices
Distributed Cache with dot microservicesDistributed Cache with dot microservices
Distributed Cache with dot microservices
Knoldus Inc.
 
Introduction to gRPC Presentation (Java)
Introduction to gRPC Presentation (Java)Introduction to gRPC Presentation (Java)
Introduction to gRPC Presentation (Java)
Knoldus Inc.
 
Using InfluxDB for real-time monitoring in Jmeter
Using InfluxDB for real-time monitoring in JmeterUsing InfluxDB for real-time monitoring in Jmeter
Using InfluxDB for real-time monitoring in Jmeter
Knoldus Inc.
 
Intoduction to KubeVela Presentation (DevOps)
Intoduction to KubeVela Presentation (DevOps)Intoduction to KubeVela Presentation (DevOps)
Intoduction to KubeVela Presentation (DevOps)
Knoldus Inc.
 
Stakeholder Management (Project Management) Presentation
Stakeholder Management (Project Management) PresentationStakeholder Management (Project Management) Presentation
Stakeholder Management (Project Management) Presentation
Knoldus Inc.
 
Introduction To Kaniko (DevOps) Presentation
Introduction To Kaniko (DevOps) PresentationIntroduction To Kaniko (DevOps) Presentation
Introduction To Kaniko (DevOps) Presentation
Knoldus Inc.
 
Efficient Test Environments with Infrastructure as Code (IaC)
Efficient Test Environments with Infrastructure as Code (IaC)Efficient Test Environments with Infrastructure as Code (IaC)
Efficient Test Environments with Infrastructure as Code (IaC)
Knoldus Inc.
 
Exploring Terramate DevOps (Presentation)
Exploring Terramate DevOps (Presentation)Exploring Terramate DevOps (Presentation)
Exploring Terramate DevOps (Presentation)
Knoldus Inc.
 
Clean Code in Test Automation Differentiating Between the Good and the Bad
Clean Code in Test Automation  Differentiating Between the Good and the BadClean Code in Test Automation  Differentiating Between the Good and the Bad
Clean Code in Test Automation Differentiating Between the Good and the Bad
Knoldus Inc.
 
Integrating AI Capabilities in Test Automation
Integrating AI Capabilities in Test AutomationIntegrating AI Capabilities in Test Automation
Integrating AI Capabilities in Test Automation
Knoldus Inc.
 
State Management with NGXS in Angular.pptx
State Management with NGXS in Angular.pptxState Management with NGXS in Angular.pptx
State Management with NGXS in Angular.pptx
Knoldus Inc.
 
Authentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptxAuthentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptx
Knoldus Inc.
 
OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)
Knoldus Inc.
 
Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptx
Knoldus Inc.
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Knoldus Inc.
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
Knoldus Inc.
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
Knoldus Inc.
 

More from Knoldus Inc. (20)

Terratest - Automation testing of infrastructure
Terratest - Automation testing of infrastructureTerratest - Automation testing of infrastructure
Terratest - Automation testing of infrastructure
 
Getting Started with Apache Spark (Scala)
Getting Started with Apache Spark (Scala)Getting Started with Apache Spark (Scala)
Getting Started with Apache Spark (Scala)
 
Secure practices with dot net services.pptx
Secure practices with dot net services.pptxSecure practices with dot net services.pptx
Secure practices with dot net services.pptx
 
Distributed Cache with dot microservices
Distributed Cache with dot microservicesDistributed Cache with dot microservices
Distributed Cache with dot microservices
 
Introduction to gRPC Presentation (Java)
Introduction to gRPC Presentation (Java)Introduction to gRPC Presentation (Java)
Introduction to gRPC Presentation (Java)
 
Using InfluxDB for real-time monitoring in Jmeter
Using InfluxDB for real-time monitoring in JmeterUsing InfluxDB for real-time monitoring in Jmeter
Using InfluxDB for real-time monitoring in Jmeter
 
Intoduction to KubeVela Presentation (DevOps)
Intoduction to KubeVela Presentation (DevOps)Intoduction to KubeVela Presentation (DevOps)
Intoduction to KubeVela Presentation (DevOps)
 
Stakeholder Management (Project Management) Presentation
Stakeholder Management (Project Management) PresentationStakeholder Management (Project Management) Presentation
Stakeholder Management (Project Management) Presentation
 
Introduction To Kaniko (DevOps) Presentation
Introduction To Kaniko (DevOps) PresentationIntroduction To Kaniko (DevOps) Presentation
Introduction To Kaniko (DevOps) Presentation
 
Efficient Test Environments with Infrastructure as Code (IaC)
Efficient Test Environments with Infrastructure as Code (IaC)Efficient Test Environments with Infrastructure as Code (IaC)
Efficient Test Environments with Infrastructure as Code (IaC)
 
Exploring Terramate DevOps (Presentation)
Exploring Terramate DevOps (Presentation)Exploring Terramate DevOps (Presentation)
Exploring Terramate DevOps (Presentation)
 
Clean Code in Test Automation Differentiating Between the Good and the Bad
Clean Code in Test Automation  Differentiating Between the Good and the BadClean Code in Test Automation  Differentiating Between the Good and the Bad
Clean Code in Test Automation Differentiating Between the Good and the Bad
 
Integrating AI Capabilities in Test Automation
Integrating AI Capabilities in Test AutomationIntegrating AI Capabilities in Test Automation
Integrating AI Capabilities in Test Automation
 
State Management with NGXS in Angular.pptx
State Management with NGXS in Angular.pptxState Management with NGXS in Angular.pptx
State Management with NGXS in Angular.pptx
 
Authentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptxAuthentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptx
 
OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)
 
Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptx
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 

Recently uploaded

316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
ssuserad3af4
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
Ayan Halder
 

Recently uploaded (20)

316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
 

Twelve Factor App With Lagom

  • 1. Presented By: Girish Chandra Bharti (Sr. Software Consultant @ Knoldus) Twelve Factor App with lagom
  • 2. Agenda 01 Introduction of twelve factor app 02 Explanation of individual principle 03 Question and answer session 04 References 60 6
  • 3. Twelve factor app principle ●Methodology for building software as a service application and these best practices are designed to enable applications to be built with portability and resilience when deployed to the web. ●It was drafted by developers at Heroku and was first presented by Adam Wiggins circa 2011.
  • 4. Twelve factor app principle ● I. Codebase ● II. Dependencies ● III. Config ● IV. Backing services ● V. Build, release, run ● VI. Processes ● VII. Port binding ● VIII. Concurrency ● IX. Disposability ● X. Dev/prod parity ● XI. Logs ● XII. Admin processes The 12 factors
  • 5. I. Codebase ● Revision control in plase. ● If there are multiple codebases, it’s not an app – it’s a distributed system. ● Each component in a distributed system is an app, and each can individually comply with twelve-factor. ● 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. One codebase tracked in revision control, many deploys
  • 6. I. Codebase ● Lagom follows this principle partially as it allows single codebase for application but also multiple services sharing the same codebase. ● That can be avoided by shared libraries. Lagom with single codebase
  • 7. II. Dependencies ● It declares all dependencies, completely and exactly, via a dependency declaration manifest ● Twelve-factor apps also do not rely on the implicit existence of any system tools (eg curl). Explicitly declare and isolate dependencies
  • 8. II. Dependencies ● Lagom follows this principle by allowing explicit dependency declaration using build.sbt (scala). Lagom dependency handling
  • 9. III. Config ● Configurables: - Resource handles to the database, Memcached, and other backing services - Credentials to external services such as Amazon S3 or Twitter - Per-deploy values such as the canonical hostname for the deploy ● Storing config as constants in the code is a violation of twelve-factor Store config in the environment
  • 10. IV. Backing services ● A backing service is any service the app consumes over the network as part of its normal operation (mysql, couchDB, kafka) ● The code for a twelve-factor app makes no distinction between local and third party services. ● To the app, both are attached resources, accessed via a URL or other locator/credentials stored in the config. ● A deploy of the twelve-factor app should be able to swap out a local MySQL database with one managed by a third party (such as Amazon RDS) without any changes to the app’s code. Treat backing services as attached resources
  • 11. V. Build, release, run ● The twelve-factor app uses strict separation between the build, release, and run stages. Strictly separate build and run stages
  • 12. V. Build, release, run ● Lagom app deployment: 1. Build (Bundle) 2. Config (RP Tool) 3 Deployment (Marathon) Lagom supports for build, release, and run stages.
  • 13. VI. 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 ● Sticky sessions (user session) are a violation of twelve-factor and should never be used or relied upon. Execute the app as one or more stateless processes
  • 14. VI. Processes ● Lagom supports event sourcing to handle stateless processes By writing event into third party database like Cassandra (by default) ● Distributed pub-sub ● CRDTS (Conflict-free replicated data type for future) Process model of lagom
  • 15. VII. Port binding ● Port-binding approach means that one app can become the backing service for another app, by providing the URL to the backing app as a resource handle in the config for the consuming app. ● The twelve-factor app is completely self-contained and does not rely on runtime injection of a webserver into the execution environment to create a web-facing service ● The web app exports HTTP as a service by binding to a port, and listening to requests coming in on that port. Export services via port binding
  • 16. ● Lagom allows to create microservices and let other services consume them using port bindings. ● To access them from outside we can make the rest rest calls VII. Port binding Port binding in lagom
  • 17. ● Using this model, the developer can architect their app to Handle diverse workloads by assigning each type of work to a process type. ● For example, HTTP requests can be handled by a web process, and long-running background tasks handled by a worker process VIII. Concurrency Scale out via the process model
  • 18. ● Supports CQRS for handling reads and writes ● Supports different dispatcher dispatchers and execution contexts VIII. Concurrency Scale out via the process model
  • 19. ● The twelve-factor app processes are disposable, meaning they can be started or stopped at a moment’s notice. ● Processes should strive to minimize startup time. ● Processes shutdown gracefully when they receive a shutdown signal from the process manager IX. Disposability Maximize robustness with fast startup and graceful shutdown
  • 20. ● Supports fast startup while deploying the application however build takes time to finish (On local might take time to start the application) ● Support graceful shutdown for rest apis and background processes ● Supports graceful shutdown for persistence entities ● User defined actors can be designed to support graceful shutdown IX. Disposability Fast startup and graceful shutdown in lagom
  • 21. ● The twelve-factor app is designed for continuous deployment by keeping the gap between development and production small. ● Recommendations: - Make the time gap small - Make the personnel gap small - Make the tools gap small X. Dev/prod parity Keep development, staging, and production as similar as possible
  • 22. ● Logs are the stream of aggregated, time-ordered events collected from the output streams of all running processes and backing services Advantages: ● Finding specific events in the past. ● Large-scale graphing of trends ● Active alerting XI. Logs Treat logs as event streams
  • 23. ● Additional administrative or maintenance tasks for the app: - Running database migrations - Running a console - Running one-time scripts ● One-off admin processes should run in an identical environment as the regular long-running processes of the app XII. Admin processes Run admin/management tasks as one-off processes

Editor's Notes

  1. Note: First “Right Click” on the Gradient background, go to “Order” option and “Send it to Back”, then insert your picture into “Image Placeholder”, “Right Click” on the picture and again go to “Order” option and “Send it to Back” to get the “Gradient” effect. <number>
  2. Revision control in plase. If there are multiple codebases, it’s not an app – it’s a distributedsystem. Each component in a distributed system is an app, and each canindividually comply with twelve-factor. 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.
  3. Lagom follows this principle partially as it allowssingle codebase for application but also multipleservices sharing the same codebase. That can be avoided by shared libraries.
  4. It declares all dependencies, completely and exactly, via a dependency declaration manifest Twelve-factor apps also do not rely on theimplicit existence of any system tools (eg curl).
  5. Lagom follows this principle by allowing explicitdependency declaration using build.sbt (scala).
  6. Configurables: - Resource handles to the database, Memcached, and other backing services - Credentials to external services such as Amazon S3 or Twitter - Per-deploy values such as the canonical hostname for the deploy Storing config as constants in the code is a violation of twelve-factor
  7. A backing service is any service the app consumes over the networkas part of its normal operation (mysql, couchDB, kafka) The code for a twelve-factor app makes no distinction betweenlocal and third party services. To the app, both are attached resources, accessed via a URL or otherlocator/credentials stored in the config. A deploy of the twelve-factor app should be able to swap out a localMySQL database with one managed by a third party (such as AmazonRDS) without any changes to the app’s code.
  8. The twelve-factor app uses strict separationbetween the build, release, and run stages.
  9. Lagom app deployment:1. Build (Bundle)2. Config (RP Tool)3 Deployment (Marathon)
  10. Twelve-factor processes are stateless and share-nothing. Any data that needs to persist must be stored in a statefulbacking service, typically a database. The twelve-factor app never assumes that anything cachedin memory or on disk will be available on a future request or job Sticky sessions (user session) are a violation of twelve-factorand should never be used or relied upon.
  11. Lagom supports event sourcing to handle stateless processesBy writing event into third party database like Cassandra (by default) Distributed pub-sub CRDTS (Conflict-free replicated data type for future)
  12. Port-binding approach means that one app can become the backing service for another app, by providing the URL to the backing app as a resource handle in the config for the consuming app. The twelve-factor app is completely self-contained and doesnot rely on runtime injection of a webserver into the executionenvironment to create a web-facing service The web app exports HTTP as a service by binding to a port,and listening to requests coming in on that port.
  13. Lagom allows to create microservices and let other servicesconsume them using port bindings. To access them from outside we can make the rest rest calls
  14. In the twelve-factor app, processes are a first class citizen. Using this model, the developer can architect their app to Handle diverse workloads by assigning each type of work to a process type. For example, HTTP requests can be handled by a web process, and long-running background tasks handled by a worker process
  15. Supports CQRS for handling reads and writes Supports different dispatcher configurations for various actors Supports various execution contexts
  16. The twelve-factor app processes are disposable, meaningthey can be started or stopped at a moment’s notice. Processes should strive to minimize startup time. Processes shutdown gracefully when they receive a shutdownsignal from the process manager For a web process, graceful shutdown is achieved by ceasing tolisten on the service port (thereby refusing any new requests),allowing any current requests to finish, and then exiting For a worker process, graceful shutdown is achieved by returningthe current job to the work queue
  17. Supports fast startup while deploying the application howeverbuild takes time to finish (On local might take time to start theapplication) Support graceful shutdown for rest apis and background processes Supports graceful shutdown for persistence entities User defined actors can be designed to support graceful shutdown
  18. The twelve-factor app is designed for continuous deployment bykeeping the gap between development and production small. Recommendations: Make the time gap small: a developer may write code and haveit deployed hours or even just minutes later. Make the personnel gap small: developers who wrote code areclosely involved in deploying it and watching its behavior inproduction. Make the tools gap small: keep development and production assimilar as possible.
  19. Logs are the stream of aggregated, time-ordered events collectedfrom the output streams of all running processes and backing services Advantages: Finding specific events in the past. Large-scale graphing of trends (such as requests per minute). Active alerting according to user-defined heuristics (such as an alertwhen the quantity of errors per minute exceeds a certain threshold).
  20. Additional administrative or maintenance tasks for the app: - Running database migrations - Running a console - Running one-time scripts One-off admin processes should run in an identical environment as the regular long-running processes of the app
  21. <number>