SlideShare a Scribd company logo
Twelve-Factor application pattern
with Spring Framework
By Dinkar Thakur
HPU Shimla
23/05/16RICSIT-2016 1
 Change in underlying architecture
 From Core to Distributed structure
 Move from monoliths to microservices
 Need for agility in the code
 Some guidelines to how to creates app for new world
 Twelve Factors - Heroku
 Framework to readily support Cloud app
development – Spring
23/05/16RICSIT-2016 2
Introduction
Developed specifically for cloud platforms
Highly Scalable
Mobile?
Agile
Run in containers?
Microservices?
Designed for failure
23/05/16RICSIT-2016 3
Cloud Native Application
• One Codebase tracked in VCS – Git, SVN.
• Multiple deployments – Different stages dev, testing,
production.
• Multiple instances of same app.
• Are there any alternatives:
1 Codebase = *Apps
* Codebase = 1 App
• Spring provide separation of configuration and fat
jars 23/05/16RICSIT-2016 4
Factor 1 -- Code Base
One code base, many deployments
• Application need libraries, can’t run in isolation
• Some are provided by language runtine
• Should not depend underlying platform
• Repeatable deployment – different platform different
machines. So Explicit dependencies
• Spring uses maven, gradle to manage dependencies
• Fat jar contain all the dependencies bundled in one
app ready to run.
23/05/16RICSIT-2016 5
Factor 2 -- Dependencies
Explicit and Isolated Dependencies
• Anything that’s likely to change between deploys
Resource handlers to database, Credentials
• Should not be present in Code, properties files, build
or app server – why?
• Store it in Environment !!
• Spring Cloud Config : Externalization of configuration
• Can be overridden by environment
• Need not to restart application
23/05/16RICSIT-2016 6
Factor 3 – Configuration
Configuration in the environment
• Backing Service are consumed over the URL.
• Access service through a URL, never locally
• Application not dependent on these to boot-up and
run
• Should not be tied to one service, but can work with
alternatives
• Spring have wrappers for most of the known services.
From messaging, caching, database, logging, even cloud
platform
23/05/16RICSIT-2016 7
Factor 4 – Backing services
Services as Attached Resource
• Build transform code to libraries, along with
dependencies – handled by developers
• Release combine libraries and configuration, releases
should be versioned
• Run make app available on server. Should be fast an
light – handled by platform like Dockers
• Spring fat jar come very handy. Build phase add all the
dependencies.
• Create standalone app just need to run. Spring config
provide the configuration
23/05/16RICSIT-2016 8
Factor 5 – Build, Release and Run
Separation between build and run stages
• Design for failure
• Many instance of same applications
• No data shared between request be kept in app
• Any instance can accept the request
• Every service should act as different process
• Spring help in create microservices which natively
support HTTP a stateless protocol
• Intermediate data can be stores in Redis or
Memcache. Ideally communication should be queued
23/05/16RICSIT-2016 9
Factor 6 – Processes*
Application as stateless share nothing
• Apps are deployed in containers
• There are multiple containers per host
• Platform handle port assignment and mapping.
• Multiple instance of application can be run on same
URL and different port.
• Spring cloud discovery act as registry server.
• All apps get registered in discovery server and
accessed by app-name
• Load balancing handled at client side.
23/05/16RICSIT-2016 10
Factor 7 – Port binding
Export services via port
 Individual instances are treated as individual process
 Application should handle one type of work.
 This model help is scaling out as we need to add more
instances
 Again each micro service
shared by URL can act as a
process.
23/05/16RICSIT-2016 11
Factor 8 – Concurrency
Scale out via Process model
• Robustness by recovering from failures
• We cannot scale, deploy, release recover fast if we
cannot start fast – that’s why we need containers and
dockers
• We cannot start fast if there is no graceful shutdown
• “Where my db connection goes, why there is locking, what was
last state of data.”
• So concept of external config, queue system and
self contained application is evident here.
• App will start fast, config is provided from outside
23/05/16RICSIT-2016 12
Factor -9 – Disposability
Maximum robustness, Fast startup, Graceful Shutdown
• Application are designed for continuous deployment
• Environment parity enable speed
• Less last time bugs while release on production
• At-least no change in the code.
• With installation of backing services like db, message
queue easing up, environments are nearly same.
• Spring provides wrapper for many services and hence
no code change required.
• Config is externalized making changes in config easy
23/05/16RICSIT-2016 13
Factor - 10 – Dev/Prod Parity
Keep dev, staging and production environment same
• Treat logs as event streams as they are generated as long
as application is running
• Log to stdout and stderr
• Routing and storing logs not part of the application
• Parsing of logs an important part to know the state of the
applications.
• Spring cloud provides component for the logging and
tracing of the events.
• Can be easily integrated with fluentd, or logstash to filler
the logs and analyze them.
23/05/16RICSIT-2016 14
Factor -11 – Logs
Logs as event stream
• Admin/Management processes run against a release
• Environment should be identical to release
• Use same codebase and config
• Should be shipped with code to avoid sync issues.
• Spring provides actuator which exposes management
endpoints
• Help in doing administration and management tasks
• Shipped with in the application
23/05/16RICSIT-2016 15
Factor – 12 – Admin processes
Running management task process
• Need to change the way we develop application
• To make a cloud native app this methodology can be
followed
• These guidelines are not forced, we can create
application for cloud without adhering to these
• They are there to make life easy
23/05/16RICSIT-2016 16
Conclusion
Thank you
Questions Any?
Mail me at thakur.dinkar@gmail.com
Tweet at @dinkarthakur
23/05/16RICSIT-2016 17
Ad

More Related Content

What's hot (17)

Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4
Tejas Purohit
 
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
BIOVIA
 
Dependency Management on iOS
Dependency Management on iOSDependency Management on iOS
Dependency Management on iOS
Make School
 
Highly available nodejs
Highly available nodejsHighly available nodejs
Highly available nodejs
pfremm
 
MuleSoft London Community November 2019 - MuleSoft and CICD
MuleSoft London Community November 2019 - MuleSoft and CICDMuleSoft London Community November 2019 - MuleSoft and CICD
MuleSoft London Community November 2019 - MuleSoft and CICD
Pace Integration
 
Github Projects Overview and IBM Streams V4.1
Github Projects Overview and IBM Streams V4.1Github Projects Overview and IBM Streams V4.1
Github Projects Overview and IBM Streams V4.1
lisanl
 
Migrating to mule 4 - Are you ready for This.
Migrating to mule 4 - Are you ready for This.Migrating to mule 4 - Are you ready for This.
Migrating to mule 4 - Are you ready for This.
Harish Kumar
 
Integrating Hybrid Cloud Database-as-a-Service with Cloud Foundry’s Service​ ...
Integrating Hybrid Cloud Database-as-a-Service with Cloud Foundry’s Service​ ...Integrating Hybrid Cloud Database-as-a-Service with Cloud Foundry’s Service​ ...
Integrating Hybrid Cloud Database-as-a-Service with Cloud Foundry’s Service​ ...
VMware Tanzu
 
Top 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
Top 15 Exchange Questions that Senior Admin ask - Jaap WesseliusTop 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
Top 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
Kemp
 
Warsaw MuleSoft Meetup #6 - CI/CD
Warsaw MuleSoft Meetup  #6 - CI/CDWarsaw MuleSoft Meetup  #6 - CI/CD
Warsaw MuleSoft Meetup #6 - CI/CD
Patryk Bandurski
 
DevOps, Kubernetes and Istio
DevOps, Kubernetes and IstioDevOps, Kubernetes and Istio
DevOps, Kubernetes and Istio
John Jardin
 
Deep Visibility: Logging From Distributed Microservices
Deep Visibility: Logging From Distributed MicroservicesDeep Visibility: Logging From Distributed Microservices
Deep Visibility: Logging From Distributed Microservices
AaronLieberman5
 
Architecting Reliability and Visibility into Integrations at Airbnb
Architecting Reliability and Visibility into Integrations at Airbnb Architecting Reliability and Visibility into Integrations at Airbnb
Architecting Reliability and Visibility into Integrations at Airbnb
MuleSoft
 
Apache flink
Apache flinkApache flink
Apache flink
Janu Jahnavi
 
Apache flink
Apache flinkApache flink
Apache flink
Janu Jahnavi
 
Navigating the Container Orchestration Maze
Navigating the Container Orchestration MazeNavigating the Container Orchestration Maze
Navigating the Container Orchestration Maze
Alex Vranceanu
 
How to setup a development environment for ONAP
How to setup a development environment for ONAPHow to setup a development environment for ONAP
How to setup a development environment for ONAP
Victor Morales
 
Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4
Tejas Purohit
 
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
BIOVIA
 
Dependency Management on iOS
Dependency Management on iOSDependency Management on iOS
Dependency Management on iOS
Make School
 
Highly available nodejs
Highly available nodejsHighly available nodejs
Highly available nodejs
pfremm
 
MuleSoft London Community November 2019 - MuleSoft and CICD
MuleSoft London Community November 2019 - MuleSoft and CICDMuleSoft London Community November 2019 - MuleSoft and CICD
MuleSoft London Community November 2019 - MuleSoft and CICD
Pace Integration
 
Github Projects Overview and IBM Streams V4.1
Github Projects Overview and IBM Streams V4.1Github Projects Overview and IBM Streams V4.1
Github Projects Overview and IBM Streams V4.1
lisanl
 
Migrating to mule 4 - Are you ready for This.
Migrating to mule 4 - Are you ready for This.Migrating to mule 4 - Are you ready for This.
Migrating to mule 4 - Are you ready for This.
Harish Kumar
 
Integrating Hybrid Cloud Database-as-a-Service with Cloud Foundry’s Service​ ...
Integrating Hybrid Cloud Database-as-a-Service with Cloud Foundry’s Service​ ...Integrating Hybrid Cloud Database-as-a-Service with Cloud Foundry’s Service​ ...
Integrating Hybrid Cloud Database-as-a-Service with Cloud Foundry’s Service​ ...
VMware Tanzu
 
Top 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
Top 15 Exchange Questions that Senior Admin ask - Jaap WesseliusTop 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
Top 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
Kemp
 
Warsaw MuleSoft Meetup #6 - CI/CD
Warsaw MuleSoft Meetup  #6 - CI/CDWarsaw MuleSoft Meetup  #6 - CI/CD
Warsaw MuleSoft Meetup #6 - CI/CD
Patryk Bandurski
 
DevOps, Kubernetes and Istio
DevOps, Kubernetes and IstioDevOps, Kubernetes and Istio
DevOps, Kubernetes and Istio
John Jardin
 
Deep Visibility: Logging From Distributed Microservices
Deep Visibility: Logging From Distributed MicroservicesDeep Visibility: Logging From Distributed Microservices
Deep Visibility: Logging From Distributed Microservices
AaronLieberman5
 
Architecting Reliability and Visibility into Integrations at Airbnb
Architecting Reliability and Visibility into Integrations at Airbnb Architecting Reliability and Visibility into Integrations at Airbnb
Architecting Reliability and Visibility into Integrations at Airbnb
MuleSoft
 
Navigating the Container Orchestration Maze
Navigating the Container Orchestration MazeNavigating the Container Orchestration Maze
Navigating the Container Orchestration Maze
Alex Vranceanu
 
How to setup a development environment for ONAP
How to setup a development environment for ONAPHow to setup a development environment for ONAP
How to setup a development environment for ONAP
Victor Morales
 

Similar to Twelve-Factor application pattern with Spring Framework (20)

Breaking the Monolith
Breaking the MonolithBreaking the Monolith
Breaking the Monolith
VMware Tanzu
 
Twelve Factor App With Lagom
Twelve Factor App With LagomTwelve Factor App With Lagom
Twelve Factor App With Lagom
Knoldus Inc.
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.js
Brad Williams
 
12-Factor Apps
12-Factor Apps12-Factor Apps
12-Factor Apps
Siva Rama Krishna Chunduru
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor app
Inthra onsap
 
Serverless: Market Overview and Investment Opportunities
Serverless: Market Overview and Investment OpportunitiesServerless: Market Overview and Investment Opportunities
Serverless: Market Overview and Investment Opportunities
Underscore VC
 
Delivering Cloud Native Batch Solutions - Dodd Pfeffer
Delivering Cloud Native Batch Solutions - Dodd PfefferDelivering Cloud Native Batch Solutions - Dodd Pfeffer
Delivering Cloud Native Batch Solutions - Dodd Pfeffer
VMware Tanzu
 
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
Rohit Kelapure
 
Adopting PCF At An Automobile Manufacturer
Adopting PCF At An Automobile ManufacturerAdopting PCF At An Automobile Manufacturer
Adopting PCF At An Automobile Manufacturer
Gregor Zurowski
 
Adopting PCF At An Automobile Manufacturer
Adopting PCF At An Automobile ManufacturerAdopting PCF At An Automobile Manufacturer
Adopting PCF At An Automobile Manufacturer
VMware Tanzu
 
Disruptive Trends in Application Development
Disruptive Trends in Application DevelopmentDisruptive Trends in Application Development
Disruptive Trends in Application Development
WaveMaker, Inc.
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles
VMware Tanzu
 
Microservices
MicroservicesMicroservices
Microservices
Abdelrahman Badreldeen
 
Pivotal Cloud Foundry 2.6: A First Look
Pivotal Cloud Foundry 2.6: A First LookPivotal Cloud Foundry 2.6: A First Look
Pivotal Cloud Foundry 2.6: A First Look
VMware Tanzu
 
MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021
Ieva Navickaite
 
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS
 
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud EnvironmentsTools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
VMware Tanzu
 
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
VMworld
 
DevOps and BigData Analytics
DevOps and BigData Analytics DevOps and BigData Analytics
DevOps and BigData Analytics
sbbabu
 
IBM Lightning Talk
IBM Lightning TalkIBM Lightning Talk
IBM Lightning Talk
MongoDB
 
Breaking the Monolith
Breaking the MonolithBreaking the Monolith
Breaking the Monolith
VMware Tanzu
 
Twelve Factor App With Lagom
Twelve Factor App With LagomTwelve Factor App With Lagom
Twelve Factor App With Lagom
Knoldus Inc.
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.js
Brad Williams
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor app
Inthra onsap
 
Serverless: Market Overview and Investment Opportunities
Serverless: Market Overview and Investment OpportunitiesServerless: Market Overview and Investment Opportunities
Serverless: Market Overview and Investment Opportunities
Underscore VC
 
Delivering Cloud Native Batch Solutions - Dodd Pfeffer
Delivering Cloud Native Batch Solutions - Dodd PfefferDelivering Cloud Native Batch Solutions - Dodd Pfeffer
Delivering Cloud Native Batch Solutions - Dodd Pfeffer
VMware Tanzu
 
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
Rohit Kelapure
 
Adopting PCF At An Automobile Manufacturer
Adopting PCF At An Automobile ManufacturerAdopting PCF At An Automobile Manufacturer
Adopting PCF At An Automobile Manufacturer
Gregor Zurowski
 
Adopting PCF At An Automobile Manufacturer
Adopting PCF At An Automobile ManufacturerAdopting PCF At An Automobile Manufacturer
Adopting PCF At An Automobile Manufacturer
VMware Tanzu
 
Disruptive Trends in Application Development
Disruptive Trends in Application DevelopmentDisruptive Trends in Application Development
Disruptive Trends in Application Development
WaveMaker, Inc.
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles
VMware Tanzu
 
Pivotal Cloud Foundry 2.6: A First Look
Pivotal Cloud Foundry 2.6: A First LookPivotal Cloud Foundry 2.6: A First Look
Pivotal Cloud Foundry 2.6: A First Look
VMware Tanzu
 
MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021MuleSoft Manchester Meetup #4 slides 11th February 2021
MuleSoft Manchester Meetup #4 slides 11th February 2021
Ieva Navickaite
 
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS
 
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud EnvironmentsTools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
VMware Tanzu
 
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
VMworld 2013: Best Practices for Application Lifecycle Management with vCloud...
VMworld
 
DevOps and BigData Analytics
DevOps and BigData Analytics DevOps and BigData Analytics
DevOps and BigData Analytics
sbbabu
 
IBM Lightning Talk
IBM Lightning TalkIBM Lightning Talk
IBM Lightning Talk
MongoDB
 
Ad

Recently uploaded (20)

Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
Exchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv SoftwareExchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv Software
Shoviv Software
 
Adobe Media Encoder Crack FREE Download 2025
Adobe Media Encoder  Crack FREE Download 2025Adobe Media Encoder  Crack FREE Download 2025
Adobe Media Encoder Crack FREE Download 2025
zafranwaqar90
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
Robotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptxRobotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptx
julia smits
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
How I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetryHow I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetry
Cees Bos
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.pptPassive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
IES VE
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
sequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineeringsequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineering
aashrithakondapalli8
 
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by AjathMobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Ajath Infotech Technologies LLC
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
Time Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project TechniquesTime Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project Techniques
Livetecs LLC
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025
Phil Eaton
 
wAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptxwAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptx
SimonedeGijt
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
Exchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv SoftwareExchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv Software
Shoviv Software
 
Adobe Media Encoder Crack FREE Download 2025
Adobe Media Encoder  Crack FREE Download 2025Adobe Media Encoder  Crack FREE Download 2025
Adobe Media Encoder Crack FREE Download 2025
zafranwaqar90
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
Robotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptxRobotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptx
julia smits
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
How I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetryHow I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetry
Cees Bos
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.pptPassive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
IES VE
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
sequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineeringsequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineering
aashrithakondapalli8
 
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by AjathMobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Ajath Infotech Technologies LLC
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
Time Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project TechniquesTime Estimation: Expert Tips & Proven Project Techniques
Time Estimation: Expert Tips & Proven Project Techniques
Livetecs LLC
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025
Phil Eaton
 
wAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptxwAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptx
SimonedeGijt
 
Ad

Twelve-Factor application pattern with Spring Framework

  • 1. Twelve-Factor application pattern with Spring Framework By Dinkar Thakur HPU Shimla 23/05/16RICSIT-2016 1
  • 2.  Change in underlying architecture  From Core to Distributed structure  Move from monoliths to microservices  Need for agility in the code  Some guidelines to how to creates app for new world  Twelve Factors - Heroku  Framework to readily support Cloud app development – Spring 23/05/16RICSIT-2016 2 Introduction
  • 3. Developed specifically for cloud platforms Highly Scalable Mobile? Agile Run in containers? Microservices? Designed for failure 23/05/16RICSIT-2016 3 Cloud Native Application
  • 4. • One Codebase tracked in VCS – Git, SVN. • Multiple deployments – Different stages dev, testing, production. • Multiple instances of same app. • Are there any alternatives: 1 Codebase = *Apps * Codebase = 1 App • Spring provide separation of configuration and fat jars 23/05/16RICSIT-2016 4 Factor 1 -- Code Base One code base, many deployments
  • 5. • Application need libraries, can’t run in isolation • Some are provided by language runtine • Should not depend underlying platform • Repeatable deployment – different platform different machines. So Explicit dependencies • Spring uses maven, gradle to manage dependencies • Fat jar contain all the dependencies bundled in one app ready to run. 23/05/16RICSIT-2016 5 Factor 2 -- Dependencies Explicit and Isolated Dependencies
  • 6. • Anything that’s likely to change between deploys Resource handlers to database, Credentials • Should not be present in Code, properties files, build or app server – why? • Store it in Environment !! • Spring Cloud Config : Externalization of configuration • Can be overridden by environment • Need not to restart application 23/05/16RICSIT-2016 6 Factor 3 – Configuration Configuration in the environment
  • 7. • Backing Service are consumed over the URL. • Access service through a URL, never locally • Application not dependent on these to boot-up and run • Should not be tied to one service, but can work with alternatives • Spring have wrappers for most of the known services. From messaging, caching, database, logging, even cloud platform 23/05/16RICSIT-2016 7 Factor 4 – Backing services Services as Attached Resource
  • 8. • Build transform code to libraries, along with dependencies – handled by developers • Release combine libraries and configuration, releases should be versioned • Run make app available on server. Should be fast an light – handled by platform like Dockers • Spring fat jar come very handy. Build phase add all the dependencies. • Create standalone app just need to run. Spring config provide the configuration 23/05/16RICSIT-2016 8 Factor 5 – Build, Release and Run Separation between build and run stages
  • 9. • Design for failure • Many instance of same applications • No data shared between request be kept in app • Any instance can accept the request • Every service should act as different process • Spring help in create microservices which natively support HTTP a stateless protocol • Intermediate data can be stores in Redis or Memcache. Ideally communication should be queued 23/05/16RICSIT-2016 9 Factor 6 – Processes* Application as stateless share nothing
  • 10. • Apps are deployed in containers • There are multiple containers per host • Platform handle port assignment and mapping. • Multiple instance of application can be run on same URL and different port. • Spring cloud discovery act as registry server. • All apps get registered in discovery server and accessed by app-name • Load balancing handled at client side. 23/05/16RICSIT-2016 10 Factor 7 – Port binding Export services via port
  • 11.  Individual instances are treated as individual process  Application should handle one type of work.  This model help is scaling out as we need to add more instances  Again each micro service shared by URL can act as a process. 23/05/16RICSIT-2016 11 Factor 8 – Concurrency Scale out via Process model
  • 12. • Robustness by recovering from failures • We cannot scale, deploy, release recover fast if we cannot start fast – that’s why we need containers and dockers • We cannot start fast if there is no graceful shutdown • “Where my db connection goes, why there is locking, what was last state of data.” • So concept of external config, queue system and self contained application is evident here. • App will start fast, config is provided from outside 23/05/16RICSIT-2016 12 Factor -9 – Disposability Maximum robustness, Fast startup, Graceful Shutdown
  • 13. • Application are designed for continuous deployment • Environment parity enable speed • Less last time bugs while release on production • At-least no change in the code. • With installation of backing services like db, message queue easing up, environments are nearly same. • Spring provides wrapper for many services and hence no code change required. • Config is externalized making changes in config easy 23/05/16RICSIT-2016 13 Factor - 10 – Dev/Prod Parity Keep dev, staging and production environment same
  • 14. • Treat logs as event streams as they are generated as long as application is running • Log to stdout and stderr • Routing and storing logs not part of the application • Parsing of logs an important part to know the state of the applications. • Spring cloud provides component for the logging and tracing of the events. • Can be easily integrated with fluentd, or logstash to filler the logs and analyze them. 23/05/16RICSIT-2016 14 Factor -11 – Logs Logs as event stream
  • 15. • Admin/Management processes run against a release • Environment should be identical to release • Use same codebase and config • Should be shipped with code to avoid sync issues. • Spring provides actuator which exposes management endpoints • Help in doing administration and management tasks • Shipped with in the application 23/05/16RICSIT-2016 15 Factor – 12 – Admin processes Running management task process
  • 16. • Need to change the way we develop application • To make a cloud native app this methodology can be followed • These guidelines are not forced, we can create application for cloud without adhering to these • They are there to make life easy 23/05/16RICSIT-2016 16 Conclusion
  • 17. Thank you Questions Any? Mail me at thakur.dinkar@gmail.com Tweet at @dinkarthakur 23/05/16RICSIT-2016 17
  翻译: