SlideShare a Scribd company logo
Build a 12 factor
microservice
-- on staging hacking
Emily Jiang
STSM, Liberty Architect of Microservicers, Advocate
Liberty Architect for MicroProfile and CDI, IBM
@emilyfhjiang
About Emily
2
Java Champion
STSM, IBM, Liberty Lead Architect for MicroProfile and CDI
Leads MicroProfile Config, Fault Tolerance, Service Mesh
Co-spec lead for Config JSR
CDI Expert Group
Based in IBM’s Hursley lab, UK
Emily Jiang
@emilyfhjiang Email: emijiang@uk.ibm.comhttps://www.linkedin.com/in/emily-jiang-60803812/
Contents
Basic concept of 12 factor app
On stage hacking of creating a 12 factor microservice using MicroProfile
12 Factors in a nut shell
– A methodology
– Best Practices
– Manifesto
https://12factor.net/ by Heroku
Why 12 factor?
• Define the contract between applications and infrastructure
Application Infrastructure
What is aTwelve-FactorApp?
In the modern era, software is commonly delivered as a service: called web apps, or software-as-a-service.The twelve-factor app is
a methodology for building software-as-a-service apps that:
Use declarative formats for setup automation, to minimize time and cost for new developers joining the project;
Have a clean contract with the underlying operating system, offering maximum portability between execution environments;
Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems administration;
Minimize divergence between development and production, enabling continuous deployment for maximum agility;
And can scale up without significant changes to tooling, architecture, or development practices.
The twelve-factor methodology can be applied to apps written in any programming language, and which use any combination of
backing services (database, queue, memory cache, etc).
From https://12factor.net
THE FACTORS
1. Codebase
2. Dependencies
3. Config
4. Backing Services
5. Build, Release, Run
6. Processes
7. Port binding
8. Concurrency
9. Disposability
10. Dev / Prod parity
11. Logs
12. Admin Processes
Community
Driven
Lightweight, Iterative
Processes
Specs, APIs, TCKs
NO Reference Implementation
Open specifications
Wide vendor support
REST services
OpenAPI support
Security
Fault Tolerance
Configuration
Metrics
Health
Open Tracing
https://wiki.eclipse.org/MicroProfile/Implementation
Quarkus
I. Codebase
• Dedicate smaller teams to individual applications or microservices.
• Following the discipline of single repository for an application forces the
teams to analyze the seams of their application, and identify potential
monoliths that should be split off into microservices.
“One codebase tracked in revision control, many deploys.”
Use a single source code repository for a single application
(1:1 relation). Deployment stages are different tags/branches
i.e. use a central git repo (external Github/GitHub Enterprise
also suitable)
II. Dependencies
A cloud-native application does not rely on the pre-existence of dependencies in a
deployment target.
DeveloperTools declare and isolate dependencies
• Maven and Gradle for Java
“Explicitly declare and isolate dependencies”
Each microservice has its own dependencies declared (e.g. pom.xml)
III. Config
“Store config in the environment”
Changing config should not need to repackage your application
Use Kubernetes configmaps and secrets (rather than environment variables) for container
services
Use MicroProfile Config to inject the config properties into the microservices
App Password=blah
IV. Backing services
“Treat backing services as attached resources”
Application
My SQL Amazon S3 Twitter
V. Build, release, run
“Strictly separate build and run stages”
Source code is used in the build stage. Configuration data is added to define a release
stage that can be deployed. Any changes in code or config will result in a new build/release
Needs to be considered in CI pipeline
IBM
• UrbanCode Deploy
• IBM Cloud Continuous
Delivery Service
Azure
• Visual StudioTeam Services
(VSTS) (includes git)
• Web App for Containers
feature of Azure App Service
AWS
• AWS CodeBuild
• AWS CodeDeploy
• AWS CodePipeline (not yet
integrated with EKS)
VI. Processes
“Execute the app as one or more stateless processes”
Stateless and share-nothing
Rest API
VII. Port binding
“Export services via port binding”
Applications are fully self-contained and expose services only through ports. Port
assignment is done by the execution environment
Ingress/service definition of k8s manages mapping of ports
Use MP Config to inject ports to microservices for chain-up invocations
Port=80
@Inject @ConfigProperty(name=”port”, defaultValue=“9080”)
VIII. Concurrency
“Scale out via the process model”
Applications use processes independent from each other to scale out (allowing for load
balancing)
To be considered in application design
Cloud autoscaling services: [auto]scaling built into k8s
Build micorservices
IX. Disposability
“Maximize robustness with fast startup and graceful shutdown”
Processes start up fast.
Processes shut down gracefully when requested.
Processes are robust against sudden death
 Use MicroProfile FaultTolerance to make it resilient
From “CERN Data Centre Evolution”
X. Dev/prod parity
“Keep development, staging, and production as similar as possible”
Development and production are as close as possible (in terms of code, people, and
environments)
Can use helm to deploy in repeatable manner
Use (name)spaces for isolation of similar setups
XI. Logs
“Treat logs as event streams”
App writes all logs to stdout
Use a structured output for meaningful logs suitable for analysis. Execution environment
handles routing and analysis infrastructure
XII. Admin processes
“Run admin/management tasks as one-off processes”
Tooling: standard k8s tooling like “kubectl exec” or Kubernetes Jobs
Also to be considered in solution/application design
For example, if an application needs to migrate data into a database, place this task into a
separate component instead of adding it to the main application code at startup
THE FACTORS
1. Codebase
2. Dependencies
3. Config
4. Backing Services
5. Build, Release, Run
6. Processes
7. Port binding
8. Concurrency
9. Disposability
10. Dev / Prod parity
11. Logs
12. Admin Processes
MicroProfile Config
Why?
– Configure Microservice without repacking the
application
How?
– Specify the configuration in configure sources
– Access configuration via
• Programmatically lookup
Config config =ConfigProvider.getConfig();
config.getValue(“myProp”, String.class);
• Via CDI Injection
@Inject
@ConfigProperty(name="my.string.property")
String myPropV;
MicroProfile Config
Static Config
Dynamic Config
@Inject
@ConfigProperty(name="myStaticProp")
private String staticProp;
@Inject
@ConfigProperty(name="myDynamicProp")
private Provider<String> dynamicProp;
microprofile-config.properties
myStaticProp=defaultSValue
myDynamicProp=defaultDValue
Java Options
-DmyStaticProp=customSValue
-DmyDynamicProp=customDValue
overrides
MicroProfile FaultTolerance
A solution to build a resilient microservice
 Retry - @Retry
 Circuit Breaker - @CircuitBreaker
 Bulk Head - @Bulkhead
 Time out - @Timeout
 Fallback - @Fallback
12 factor app
• Use MicroProfile and K8s to build a microservice => 12 factor app
microservice
Infrastructure
K8s
References
• http://microprofile.io
• http://openliberty.io
• https://www.12factor.net/
• https://github.com/Emily-Jiang/12factor-app-a
• https://github.com/Emily-Jiang/12factor-app-b
• https://github.com/Emily-Jiang/12factor-deployment
microservice
Infrastructure
K8s
Backup: Using IBM Cloud Private
Codebase Source: Github Enterprise,
github
Images: any registry, IBM
Cloud private registry
Dependencies Dependency management
of language environment;
container build process for
repeatable inclusion of
dependencies
Config k8s configmaps and secrets
Backing services Use configuration (see
previous factor) to define
target server as used by
application
Build, release, run UrbanCode Deploy
UrbanCode Release
Plus k8s mechanisms with CI
tooling
Processes To be considered in
application design
Port binding Application needs to expose
ports. Ingress/service
definition of k8s manages
mapping of ports
Concurrency App design ([auto]scaling
built into k8s)
Disposability App design
Dev/prod parity Can use helm to deploy in
same way. Namespaces for
isolation of similar areas
Logs ELK as part of ICP (or RYO)
Admin processes App design; standard k8s
tooling like “kubectl exec” or
Kubernetes Jobs

More Related Content

What's hot

Microservice Pattern Launguage
Microservice Pattern LaunguageMicroservice Pattern Launguage
Microservice Pattern Launguage
Inho Kang
 
Microservices architecture overview v3
Microservices architecture overview v3Microservices architecture overview v3
Microservices architecture overview v3
Dmitry Skaredov
 
Building a High-Performance Reactive Microservices Architecture
Building a High-Performance Reactive Microservices ArchitectureBuilding a High-Performance Reactive Microservices Architecture
Building a High-Performance Reactive Microservices Architecture
Cognizant
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology Stack
Eberhard Wolff
 
From a monolith to microservices + REST: The evolution of LinkedIn's architec...
From a monolith to microservices + REST: The evolution of LinkedIn's architec...From a monolith to microservices + REST: The evolution of LinkedIn's architec...
From a monolith to microservices + REST: The evolution of LinkedIn's architec...
Karan Parikh
 
REST and Microservices
REST and MicroservicesREST and Microservices
REST and Microservices
Shaun Abram
 
Exposing APIs with Liberty and Swagger
Exposing APIs with Liberty and SwaggerExposing APIs with Liberty and Swagger
Exposing APIs with Liberty and Swagger
Arthur De Magalhaes
 
Cloud native java workshop
Cloud native java workshopCloud native java workshop
Cloud native java workshop
Jamie Coleman
 
Azure serverless computing
Azure serverless computingAzure serverless computing
Azure serverless computing
Udaiappa Ramachandran
 
Cloud Foundry Technical Overview
Cloud Foundry Technical OverviewCloud Foundry Technical Overview
Cloud Foundry Technical Overview
cornelia davis
 
Cloudfoundry architecture
Cloudfoundry architectureCloudfoundry architecture
Cloudfoundry architecture
Ramnivas Laddad
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
Nguyen Tung
 
Using IBM WebSphere Liberty and Swagger to Make your Services Accessible
Using IBM WebSphere Liberty and Swagger to Make your Services AccessibleUsing IBM WebSphere Liberty and Swagger to Make your Services Accessible
Using IBM WebSphere Liberty and Swagger to Make your Services Accessible
Arthur De Magalhaes
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
Araf Karsh Hamid
 
FORUM PA 2015 - Microservices with IBM Bluemix
FORUM PA 2015 - Microservices with IBM BluemixFORUM PA 2015 - Microservices with IBM Bluemix
FORUM PA 2015 - Microservices with IBM Bluemix
gjuljo
 
12-Factor Apps
12-Factor Apps12-Factor Apps
Pivotal Cloud Foundry 2.4: A First Look
Pivotal Cloud Foundry 2.4: A First LookPivotal Cloud Foundry 2.4: A First Look
Pivotal Cloud Foundry 2.4: A First Look
VMware Tanzu
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
Araf Karsh Hamid
 
Azure privatelink
Azure privatelinkAzure privatelink
Azure privatelink
Udaiappa Ramachandran
 
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of ChoicePaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
Isaac Christoffersen
 

What's hot (20)

Microservice Pattern Launguage
Microservice Pattern LaunguageMicroservice Pattern Launguage
Microservice Pattern Launguage
 
Microservices architecture overview v3
Microservices architecture overview v3Microservices architecture overview v3
Microservices architecture overview v3
 
Building a High-Performance Reactive Microservices Architecture
Building a High-Performance Reactive Microservices ArchitectureBuilding a High-Performance Reactive Microservices Architecture
Building a High-Performance Reactive Microservices Architecture
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology Stack
 
From a monolith to microservices + REST: The evolution of LinkedIn's architec...
From a monolith to microservices + REST: The evolution of LinkedIn's architec...From a monolith to microservices + REST: The evolution of LinkedIn's architec...
From a monolith to microservices + REST: The evolution of LinkedIn's architec...
 
REST and Microservices
REST and MicroservicesREST and Microservices
REST and Microservices
 
Exposing APIs with Liberty and Swagger
Exposing APIs with Liberty and SwaggerExposing APIs with Liberty and Swagger
Exposing APIs with Liberty and Swagger
 
Cloud native java workshop
Cloud native java workshopCloud native java workshop
Cloud native java workshop
 
Azure serverless computing
Azure serverless computingAzure serverless computing
Azure serverless computing
 
Cloud Foundry Technical Overview
Cloud Foundry Technical OverviewCloud Foundry Technical Overview
Cloud Foundry Technical Overview
 
Cloudfoundry architecture
Cloudfoundry architectureCloudfoundry architecture
Cloudfoundry architecture
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Using IBM WebSphere Liberty and Swagger to Make your Services Accessible
Using IBM WebSphere Liberty and Swagger to Make your Services AccessibleUsing IBM WebSphere Liberty and Swagger to Make your Services Accessible
Using IBM WebSphere Liberty and Swagger to Make your Services Accessible
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
FORUM PA 2015 - Microservices with IBM Bluemix
FORUM PA 2015 - Microservices with IBM BluemixFORUM PA 2015 - Microservices with IBM Bluemix
FORUM PA 2015 - Microservices with IBM Bluemix
 
12-Factor Apps
12-Factor Apps12-Factor Apps
12-Factor Apps
 
Pivotal Cloud Foundry 2.4: A First Look
Pivotal Cloud Foundry 2.4: A First LookPivotal Cloud Foundry 2.4: A First Look
Pivotal Cloud Foundry 2.4: A First Look
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
 
Azure privatelink
Azure privatelinkAzure privatelink
Azure privatelink
 
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of ChoicePaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
 

Similar to Build12 factorappusingmp

Building 12-factor Cloud Native Microservices
Building 12-factor Cloud Native MicroservicesBuilding 12-factor Cloud Native Microservices
Building 12-factor Cloud Native Microservices
Jakarta_EE
 
Easy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsEasy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applications
Jack-Junjie Cai
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoring
Oracle Korea
 
Spring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics MonitoringSpring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics Monitoring
DonghuKIM2
 
Java Development on Bluemix
Java Development on BluemixJava Development on Bluemix
Java Development on Bluemix
Ram Vennam
 
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
 
Learn how to Leverage Kubernetes to Support 12 Factor for Enterprise Apps
 Learn how to Leverage Kubernetes to Support 12 Factor for Enterprise Apps Learn how to Leverage Kubernetes to Support 12 Factor for Enterprise Apps
Learn how to Leverage Kubernetes to Support 12 Factor for Enterprise Apps
Michael Elder
 
Accelerate Digital Transformation with IBM Cloud Private
Accelerate Digital Transformation with IBM Cloud PrivateAccelerate Digital Transformation with IBM Cloud Private
Accelerate Digital Transformation with IBM Cloud Private
Michael Elder
 
DevoxxBelgium_StatefulCloud.pptx
DevoxxBelgium_StatefulCloud.pptxDevoxxBelgium_StatefulCloud.pptx
DevoxxBelgium_StatefulCloud.pptx
Grace Jansen
 
400.RED HAT OPENSHIFT APPLICATION RUNTIMES(RHOAR) 를 활용한 Cloud Native App 전환
400.RED HAT OPENSHIFT APPLICATION RUNTIMES(RHOAR) 를 활용한 Cloud Native App 전환400.RED HAT OPENSHIFT APPLICATION RUNTIMES(RHOAR) 를 활용한 Cloud Native App 전환
400.RED HAT OPENSHIFT APPLICATION RUNTIMES(RHOAR) 를 활용한 Cloud Native App 전환
Opennaru, inc.
 
UtrechtJUG_Exploring statefulmicroservices in a cloud-native world.pptx
UtrechtJUG_Exploring statefulmicroservices in a cloud-native world.pptxUtrechtJUG_Exploring statefulmicroservices in a cloud-native world.pptx
UtrechtJUG_Exploring statefulmicroservices in a cloud-native world.pptx
Grace Jansen
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?
NGINX, Inc.
 
An architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbencyAn architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbency
Michael Elder
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor app
Ravi Okade
 
Accelerate Digital Transformation with IBM Cloud Private
Accelerate Digital Transformation with IBM Cloud PrivateAccelerate Digital Transformation with IBM Cloud Private
Accelerate Digital Transformation with IBM Cloud Private
Michael Elder
 
Docker12 factor
Docker12 factorDocker12 factor
Docker12 factor
John Zaccone
 
Connecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in BluemixConnecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in Bluemix
IBM
 
Twelve factor-app
Twelve factor-appTwelve factor-app
Twelve factor-app
José Javier Vélez Colón
 
Sukumar Nayak-Agile-DevOps-Cloud Management
Sukumar Nayak-Agile-DevOps-Cloud ManagementSukumar Nayak-Agile-DevOps-Cloud Management
Sukumar Nayak-Agile-DevOps-Cloud ManagementSukumar Nayak
 
Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?
Phil Estes
 

Similar to Build12 factorappusingmp (20)

Building 12-factor Cloud Native Microservices
Building 12-factor Cloud Native MicroservicesBuilding 12-factor Cloud Native Microservices
Building 12-factor Cloud Native Microservices
 
Easy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsEasy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applications
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoring
 
Spring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics MonitoringSpring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics Monitoring
 
Java Development on Bluemix
Java Development on BluemixJava Development on Bluemix
Java Development on Bluemix
 
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
 
Learn how to Leverage Kubernetes to Support 12 Factor for Enterprise Apps
 Learn how to Leverage Kubernetes to Support 12 Factor for Enterprise Apps Learn how to Leverage Kubernetes to Support 12 Factor for Enterprise Apps
Learn how to Leverage Kubernetes to Support 12 Factor for Enterprise Apps
 
Accelerate Digital Transformation with IBM Cloud Private
Accelerate Digital Transformation with IBM Cloud PrivateAccelerate Digital Transformation with IBM Cloud Private
Accelerate Digital Transformation with IBM Cloud Private
 
DevoxxBelgium_StatefulCloud.pptx
DevoxxBelgium_StatefulCloud.pptxDevoxxBelgium_StatefulCloud.pptx
DevoxxBelgium_StatefulCloud.pptx
 
400.RED HAT OPENSHIFT APPLICATION RUNTIMES(RHOAR) 를 활용한 Cloud Native App 전환
400.RED HAT OPENSHIFT APPLICATION RUNTIMES(RHOAR) 를 활용한 Cloud Native App 전환400.RED HAT OPENSHIFT APPLICATION RUNTIMES(RHOAR) 를 활용한 Cloud Native App 전환
400.RED HAT OPENSHIFT APPLICATION RUNTIMES(RHOAR) 를 활용한 Cloud Native App 전환
 
UtrechtJUG_Exploring statefulmicroservices in a cloud-native world.pptx
UtrechtJUG_Exploring statefulmicroservices in a cloud-native world.pptxUtrechtJUG_Exploring statefulmicroservices in a cloud-native world.pptx
UtrechtJUG_Exploring statefulmicroservices in a cloud-native world.pptx
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?
 
An architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbencyAn architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbency
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor app
 
Accelerate Digital Transformation with IBM Cloud Private
Accelerate Digital Transformation with IBM Cloud PrivateAccelerate Digital Transformation with IBM Cloud Private
Accelerate Digital Transformation with IBM Cloud Private
 
Docker12 factor
Docker12 factorDocker12 factor
Docker12 factor
 
Connecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in BluemixConnecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in Bluemix
 
Twelve factor-app
Twelve factor-appTwelve factor-app
Twelve factor-app
 
Sukumar Nayak-Agile-DevOps-Cloud Management
Sukumar Nayak-Agile-DevOps-Cloud ManagementSukumar Nayak-Agile-DevOps-Cloud Management
Sukumar Nayak-Agile-DevOps-Cloud Management
 
Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?
 

More from Emily Jiang

Cloud nativeworkshop
Cloud nativeworkshopCloud nativeworkshop
Cloud nativeworkshop
Emily Jiang
 
Cloud nativemicroservices jax-london2020
Cloud nativemicroservices   jax-london2020Cloud nativemicroservices   jax-london2020
Cloud nativemicroservices jax-london2020
Emily Jiang
 
Reactive microserviceinaction
Reactive microserviceinactionReactive microserviceinaction
Reactive microserviceinaction
Emily Jiang
 
Cloud nativemicroservices jax-london2020
Cloud nativemicroservices   jax-london2020Cloud nativemicroservices   jax-london2020
Cloud nativemicroservices jax-london2020
Emily Jiang
 
Reactive microserviceinaction@devnexus
Reactive microserviceinaction@devnexusReactive microserviceinaction@devnexus
Reactive microserviceinaction@devnexus
Emily Jiang
 
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
Emily Jiang
 
Cloud native programming model comparison
Cloud native programming model comparisonCloud native programming model comparison
Cloud native programming model comparison
Emily Jiang
 
Cloud native programming model comparison
Cloud native programming model comparisonCloud native programming model comparison
Cloud native programming model comparison
Emily Jiang
 
Micro profile and istio
Micro profile and istioMicro profile and istio
Micro profile and istio
Emily Jiang
 
Building cloud native microservices
Building cloud native microservicesBuilding cloud native microservices
Building cloud native microservices
Emily Jiang
 
The new and smart way to build microservices - Eclipse MicroProfile
The new and smart way to build microservices - Eclipse MicroProfileThe new and smart way to build microservices - Eclipse MicroProfile
The new and smart way to build microservices - Eclipse MicroProfile
Emily Jiang
 
New and smart way to develop microservice for istio with micro profile
New and smart way to develop microservice for istio with micro profileNew and smart way to develop microservice for istio with micro profile
New and smart way to develop microservice for istio with micro profile
Emily Jiang
 

More from Emily Jiang (12)

Cloud nativeworkshop
Cloud nativeworkshopCloud nativeworkshop
Cloud nativeworkshop
 
Cloud nativemicroservices jax-london2020
Cloud nativemicroservices   jax-london2020Cloud nativemicroservices   jax-london2020
Cloud nativemicroservices jax-london2020
 
Reactive microserviceinaction
Reactive microserviceinactionReactive microserviceinaction
Reactive microserviceinaction
 
Cloud nativemicroservices jax-london2020
Cloud nativemicroservices   jax-london2020Cloud nativemicroservices   jax-london2020
Cloud nativemicroservices jax-london2020
 
Reactive microserviceinaction@devnexus
Reactive microserviceinaction@devnexusReactive microserviceinaction@devnexus
Reactive microserviceinaction@devnexus
 
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
 
Cloud native programming model comparison
Cloud native programming model comparisonCloud native programming model comparison
Cloud native programming model comparison
 
Cloud native programming model comparison
Cloud native programming model comparisonCloud native programming model comparison
Cloud native programming model comparison
 
Micro profile and istio
Micro profile and istioMicro profile and istio
Micro profile and istio
 
Building cloud native microservices
Building cloud native microservicesBuilding cloud native microservices
Building cloud native microservices
 
The new and smart way to build microservices - Eclipse MicroProfile
The new and smart way to build microservices - Eclipse MicroProfileThe new and smart way to build microservices - Eclipse MicroProfile
The new and smart way to build microservices - Eclipse MicroProfile
 
New and smart way to develop microservice for istio with micro profile
New and smart way to develop microservice for istio with micro profileNew and smart way to develop microservice for istio with micro profile
New and smart way to develop microservice for istio with micro profile
 

Recently uploaded

space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 

Recently uploaded (20)

space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 

Build12 factorappusingmp

  • 1. Build a 12 factor microservice -- on staging hacking Emily Jiang STSM, Liberty Architect of Microservicers, Advocate Liberty Architect for MicroProfile and CDI, IBM @emilyfhjiang
  • 2. About Emily 2 Java Champion STSM, IBM, Liberty Lead Architect for MicroProfile and CDI Leads MicroProfile Config, Fault Tolerance, Service Mesh Co-spec lead for Config JSR CDI Expert Group Based in IBM’s Hursley lab, UK Emily Jiang @emilyfhjiang Email: emijiang@uk.ibm.comhttps://www.linkedin.com/in/emily-jiang-60803812/
  • 3. Contents Basic concept of 12 factor app On stage hacking of creating a 12 factor microservice using MicroProfile
  • 4. 12 Factors in a nut shell – A methodology – Best Practices – Manifesto https://12factor.net/ by Heroku
  • 5. Why 12 factor? • Define the contract between applications and infrastructure Application Infrastructure
  • 6. What is aTwelve-FactorApp? In the modern era, software is commonly delivered as a service: called web apps, or software-as-a-service.The twelve-factor app is a methodology for building software-as-a-service apps that: Use declarative formats for setup automation, to minimize time and cost for new developers joining the project; Have a clean contract with the underlying operating system, offering maximum portability between execution environments; Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems administration; Minimize divergence between development and production, enabling continuous deployment for maximum agility; And can scale up without significant changes to tooling, architecture, or development practices. The twelve-factor methodology can be applied to apps written in any programming language, and which use any combination of backing services (database, queue, memory cache, etc). From https://12factor.net
  • 7. THE FACTORS 1. Codebase 2. Dependencies 3. Config 4. Backing Services 5. Build, Release, Run 6. Processes 7. Port binding 8. Concurrency 9. Disposability 10. Dev / Prod parity 11. Logs 12. Admin Processes
  • 9. Open specifications Wide vendor support REST services OpenAPI support Security Fault Tolerance Configuration Metrics Health Open Tracing https://wiki.eclipse.org/MicroProfile/Implementation Quarkus
  • 10. I. Codebase • Dedicate smaller teams to individual applications or microservices. • Following the discipline of single repository for an application forces the teams to analyze the seams of their application, and identify potential monoliths that should be split off into microservices. “One codebase tracked in revision control, many deploys.” Use a single source code repository for a single application (1:1 relation). Deployment stages are different tags/branches i.e. use a central git repo (external Github/GitHub Enterprise also suitable)
  • 11. II. Dependencies A cloud-native application does not rely on the pre-existence of dependencies in a deployment target. DeveloperTools declare and isolate dependencies • Maven and Gradle for Java “Explicitly declare and isolate dependencies” Each microservice has its own dependencies declared (e.g. pom.xml)
  • 12. III. Config “Store config in the environment” Changing config should not need to repackage your application Use Kubernetes configmaps and secrets (rather than environment variables) for container services Use MicroProfile Config to inject the config properties into the microservices App Password=blah
  • 13. IV. Backing services “Treat backing services as attached resources” Application My SQL Amazon S3 Twitter
  • 14. V. Build, release, run “Strictly separate build and run stages” Source code is used in the build stage. Configuration data is added to define a release stage that can be deployed. Any changes in code or config will result in a new build/release Needs to be considered in CI pipeline IBM • UrbanCode Deploy • IBM Cloud Continuous Delivery Service Azure • Visual StudioTeam Services (VSTS) (includes git) • Web App for Containers feature of Azure App Service AWS • AWS CodeBuild • AWS CodeDeploy • AWS CodePipeline (not yet integrated with EKS)
  • 15. VI. Processes “Execute the app as one or more stateless processes” Stateless and share-nothing Rest API
  • 16. VII. Port binding “Export services via port binding” Applications are fully self-contained and expose services only through ports. Port assignment is done by the execution environment Ingress/service definition of k8s manages mapping of ports Use MP Config to inject ports to microservices for chain-up invocations Port=80 @Inject @ConfigProperty(name=”port”, defaultValue=“9080”)
  • 17. VIII. Concurrency “Scale out via the process model” Applications use processes independent from each other to scale out (allowing for load balancing) To be considered in application design Cloud autoscaling services: [auto]scaling built into k8s Build micorservices
  • 18. IX. Disposability “Maximize robustness with fast startup and graceful shutdown” Processes start up fast. Processes shut down gracefully when requested. Processes are robust against sudden death  Use MicroProfile FaultTolerance to make it resilient From “CERN Data Centre Evolution”
  • 19. X. Dev/prod parity “Keep development, staging, and production as similar as possible” Development and production are as close as possible (in terms of code, people, and environments) Can use helm to deploy in repeatable manner Use (name)spaces for isolation of similar setups
  • 20. XI. Logs “Treat logs as event streams” App writes all logs to stdout Use a structured output for meaningful logs suitable for analysis. Execution environment handles routing and analysis infrastructure
  • 21. XII. Admin processes “Run admin/management tasks as one-off processes” Tooling: standard k8s tooling like “kubectl exec” or Kubernetes Jobs Also to be considered in solution/application design For example, if an application needs to migrate data into a database, place this task into a separate component instead of adding it to the main application code at startup
  • 22. THE FACTORS 1. Codebase 2. Dependencies 3. Config 4. Backing Services 5. Build, Release, Run 6. Processes 7. Port binding 8. Concurrency 9. Disposability 10. Dev / Prod parity 11. Logs 12. Admin Processes
  • 23. MicroProfile Config Why? – Configure Microservice without repacking the application How? – Specify the configuration in configure sources – Access configuration via • Programmatically lookup Config config =ConfigProvider.getConfig(); config.getValue(“myProp”, String.class); • Via CDI Injection @Inject @ConfigProperty(name="my.string.property") String myPropV;
  • 24. MicroProfile Config Static Config Dynamic Config @Inject @ConfigProperty(name="myStaticProp") private String staticProp; @Inject @ConfigProperty(name="myDynamicProp") private Provider<String> dynamicProp; microprofile-config.properties myStaticProp=defaultSValue myDynamicProp=defaultDValue Java Options -DmyStaticProp=customSValue -DmyDynamicProp=customDValue overrides
  • 25. MicroProfile FaultTolerance A solution to build a resilient microservice  Retry - @Retry  Circuit Breaker - @CircuitBreaker  Bulk Head - @Bulkhead  Time out - @Timeout  Fallback - @Fallback
  • 26. 12 factor app • Use MicroProfile and K8s to build a microservice => 12 factor app microservice Infrastructure K8s
  • 27. References • http://microprofile.io • http://openliberty.io • https://www.12factor.net/ • https://github.com/Emily-Jiang/12factor-app-a • https://github.com/Emily-Jiang/12factor-app-b • https://github.com/Emily-Jiang/12factor-deployment microservice Infrastructure K8s
  • 28. Backup: Using IBM Cloud Private Codebase Source: Github Enterprise, github Images: any registry, IBM Cloud private registry Dependencies Dependency management of language environment; container build process for repeatable inclusion of dependencies Config k8s configmaps and secrets Backing services Use configuration (see previous factor) to define target server as used by application Build, release, run UrbanCode Deploy UrbanCode Release Plus k8s mechanisms with CI tooling Processes To be considered in application design Port binding Application needs to expose ports. Ingress/service definition of k8s manages mapping of ports Concurrency App design ([auto]scaling built into k8s) Disposability App design Dev/prod parity Can use helm to deploy in same way. Namespaces for isolation of similar areas Logs ELK as part of ICP (or RYO) Admin processes App design; standard k8s tooling like “kubectl exec” or Kubernetes Jobs

Editor's Notes

  1. Application design influences the infrastructure required (Kubernetes, Database selection, etc…) Application design guides price; a cloud-native application can be resilient without surplus infrastructure Some services are provided by an application but some are provided from the infrastructure Applications depend on the features and services of infrastructure to support agile development. Infrastructure requires applications to expose endpoints and integrations to be managed autonomously (e.g. Kubenetes asks applications to expose health endpoint) Increased resource and memory consumption of independently running components that need their own runtime containers with more memory and CPU Development, deployment, and operational management overheads can be expensive, requiring a high initial investment to run
  2. Java EE 8 progress was very slow. Cloud-native requirements not being addressed quickly enough MicroProfile set up in Mid 2016 as an industry collaboration.
  3. A codebase is any single repo (in a centralized revision control system like Subversion), or any set of repos who share a root commit (in a decentralized system like Git where changes are committed.) Also in Git – scenario of repository per package/service. multiple repository advantages: Clear ownership: team that owns a service is clearly responsible for independently develop and deploy the full stack of that service Smaller code base: Separate repositories for a service leads to smaller code base and lesser complexity during code merge. Narrow clones: faster DevOps and automated build and releases as smaller code base means lesscode download/clone time multiple repository disadvantages: Difficult development and debugging: development, cross team communications and shared codes are difficult to maintain and thus development and debugging can be an issue Abstracts the knowledge of the platform: Since each team is only responsible for a single service, integration becomes an issue and knowledge of the platform can decrease Multiple Everything: Multiple dependencies, duplication and integrations
  4. Do these make sense? –HJ (struggling how these offerings help pushing configurations –ub) Let’s leave them because we have the space. I’m not really attached to them, so we can delete…
  5. A backing service is any service on which an application relies (data stores, messaging systems, caching systems, security services) Use configuration (see factor III) to define target service as used by application. Configuration defines access to a backing service Resource Binding should be done via external configuration. Attach and detach backing services from an application at will, without re-deploying the application. Fault Tolerance pattern: allow code to stop communicating with misbehaving backing services, providing a fallback path
  6. Components are stateless and shared-nothing. State can be put in a stateful backing service (database) Stateless components can be replaced quickly if they fail Avoid dependencies on sticky sessions and keep session data in a persistent store to ensure traffic can be routed to other processes without service disruption To be considered in application design by the developer, not in Cloud roll-out
  7. Application design influences the infrastructure required (Kubernetes, Database selection, etc…) Application design guides price; a cloud-native application can be resilient without surplus infrastructure Some services are provided by an application but some are provided from the infrastructure Applications depend on the features and services of infrastructure to support agile development. Infrastructure requires applications to expose endpoints and integrations to be managed autonomously (e.g. Kubenetes asks applications to expose health endpoint) Increased resource and memory consumption of independently running components that need their own runtime containers with more memory and CPU Development, deployment, and operational management overheads can be expensive, requiring a high initial investment to run
  8. Application design influences the infrastructure required (Kubernetes, Database selection, etc…) Application design guides price; a cloud-native application can be resilient without surplus infrastructure Some services are provided by an application but some are provided from the infrastructure Applications depend on the features and services of infrastructure to support agile development. Infrastructure requires applications to expose endpoints and integrations to be managed autonomously (e.g. Kubenetes asks applications to expose health endpoint) Increased resource and memory consumption of independently running components that need their own runtime containers with more memory and CPU Development, deployment, and operational management overheads can be expensive, requiring a high initial investment to run