18.1
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
What is Docker?
18.2
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
What is Docker?
•
Open source project and company
18.3
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
What is Docker?
•
Open source project and company
•
Used to create containers for software applications
18.4
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
What is Docker?
•
Open source project and company
•
Used to create containers for software applications
•
Package Once Deploy Anywhere (PODA)
18.5
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages
18.6
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages
•
Isolation
18.7
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages
•
Isolation
•
Portability - “it works on my machine”
18.8
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages
•
Isolation
•
Portability - “it works on my machine”
•
Snapshotting - Upgrade/downgrade application versions
18.9
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages
•
Isolation
•
Portability - “it works on my machine”
•
Snapshotting - Upgrade/downgrade application versions
•
Security sandbox
18.10
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages
•
Isolation
•
Portability - “it works on my machine”
•
Snapshotting - Upgrade/downgrade application versions
•
Security sandbox
•
Limit resource usage
18.11
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages
•
Isolation
•
Portability - “it works on my machine”
•
Snapshotting - Upgrade/downgrade application versions
•
Security sandbox
•
Limit resource usage
•
Lightweight footprint and minimal overhead
18.12
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages
•
Isolation
•
Portability - “it works on my machine”
•
Snapshotting - Upgrade/downgrade application versions
•
Security sandbox
•
Limit resource usage
•
Lightweight footprint and minimal overhead
•
Simplified dependency
18.13
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages
•
Isolation
•
Portability - “it works on my machine”
•
Snapshotting - Upgrade/downgrade application versions
•
Security sandbox
•
Limit resource usage
•
Lightweight footprint and minimal overhead
•
Simplified dependency
•
Sharing
18.14
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages
•
Isolation
•
Portability - “it works on my machine”
•
Snapshotting - Upgrade/downgrade application versions
•
Security sandbox
•
Limit resource usage
•
Lightweight footprint and minimal overhead
•
Simplified dependency
•
Sharing
•
Faster Deployments
18.15
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Underlying Technology
18.16
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Underlying Technology
•
Written in Go
18.17
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Underlying Technology
•
Written in Go
•
Uses several Linux features
18.18
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Underlying Technology
•
Written in Go
•
Uses several Linux features
18.19
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Underlying Technology
•
Written in Go
•
Uses several Linux features
18.20
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Underlying Technology
•
Written in Go
•
Uses several Linux features
18.21
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Underlying Technology
•
Written in Go
•
Uses several Linux features
18.22
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Is it only Linux?
18.23
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Is it only Linux?
•
Natively supported in Linux
18.24
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Is it only Linux?
•
Natively supported in Linux
•
Can be installed on Mac or Windows using
boot2docker
18.25
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Is it only Linux?
•
Natively supported in Linux
•
Can be installed on Mac or Windows using
boot2docker
18.26
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.27
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.28
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Docker Workflow
Docker Hub
Docker Host
Daemon
Docker Client
18.29
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Docker Workflow
Docker Hub
Docker Host
Daemon
Docker Client
docker run <image> docker …
18.30
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Docker Workflow
Docker Hub
Docker Host
Daemon
Docker Client
docker run <image> docker …
18.31
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Docker Workflow
Docker Hub
Image 1
Image 2
Image 3
Image M
Docker Host
Daemon
Docker Client
docker run <image> docker …
18.32
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Docker Workflow
Docker Hub
Image 1
Image 2
Image 3
Image M
Docker Host
Image 1
Image 2
Image 3
Image N
Daemon
Docker Client
docker run <image> docker …
18.33
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Docker Workflow
Docker Hub
Image 1
Image 2
Image 3
Image M
Docker Host
Image 1
Image 2
Image 3
Image N
Daemon
Container 1
Container 2
Container O
Docker Client
docker run <image> docker …
18.34
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
read-only
18.35
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Union File System
read-only
18.36
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Union File System
read-only
18.37
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.38
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Image defined in text-based Dockerfile
•
18.39
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Image defined in text-based Dockerfile
•
•
List of commands to build the image
18.40
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Image defined in text-based Dockerfile
•
•
List of commands to build the image
FROM fedora:latest
CMD echo “Hello world”
18.41
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Image defined in text-based Dockerfile
•
•
List of commands to build the image
FROM fedora:latest
CMD echo “Hello world”
FROM jboss/wildlfy
MAINTAINER Arun Gupta <arungupta@redhat.com>
RUN curl -L https://github.com/javaee-samples/javaee7-hol/raw/master/solution/ movieplex7-1.0-SNAPSHOT.war -o /opt/jboss/wildfly/standalone/deployments/ movieplex7-1.0-SNAPSHOT.war
18.42
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Image defined in text-based Dockerfile
•
•
List of commands to build the image
•
docker build or pull
FROM fedora:latest
CMD echo “Hello world”
FROM jboss/wildlfy
MAINTAINER Arun Gupta <arungupta@redhat.com>
RUN curl -L https://github.com/javaee-samples/javaee7-hol/raw/master/solution/ movieplex7-1.0-SNAPSHOT.war -o /opt/jboss/wildfly/standalone/deployments/ movieplex7-1.0-SNAPSHOT.war
18.43
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.44
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.45
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.46
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Images shared using registry
•
18.47
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Images shared using registry
•
•
Docker Hub is public SaaS
18.48
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Images shared using registry
•
•
Docker Hub is public SaaS
•
Private registries can be setup inside firewall
18.49
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Images shared using registry
•
•
Docker Hub is public SaaS
•
Private registries can be setup inside firewall
•
docker push or pull <IMAGE_ID>
18.50
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.51
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Container built from image
•
18.52
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Container built from image
•
•
Runtime representation of image
18.53
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Container built from image
•
•
Runtime representation of image
•
Self contained execution environment
18.54
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Container built from image
•
•
Runtime representation of image
•
Self contained execution environment
•
docker run <IMAGE_ID>
18.55
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Docker commands
•
docker ps: List running containers
•
docker stop: Stop a running container
•
docker rm: Remove a running container
•
docker rmi: Remove an image
•
…
18.56
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.57
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.58
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.59
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.60
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.61
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Benefits of Containers
18.62
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Application Operating Environment
18.63
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Kubernetes
18.64
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Kubernetes
•
Open source orchestration system for Docker containers
18.65
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Kubernetes
•
Open source orchestration system for Docker containers
•
Provide declarative primitives for the “desired state”
18.66
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Kubernetes
•
Open source orchestration system for Docker containers
•
Provide declarative primitives for the “desired state”
18.67
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Kubernetes
•
Open source orchestration system for Docker containers
•
Provide declarative primitives for the “desired state”
18.68
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Kubernetes
•
Open source orchestration system for Docker containers
•
Provide declarative primitives for the “desired state”
18.69
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Kubernetes
•
Open source orchestration system for Docker containers
•
Provide declarative primitives for the “desired state”
18.70
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Key Concepts
18.71
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Key Concepts
•
Pods: Smallest deployable unit that can be created, scheduled, managed (logical collection of containers)
18.72
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Key Concepts
•
Pods: Smallest deployable unit that can be created, scheduled, managed (logical collection of containers)
•
Master: Central point that provides unified view of cluster, control one or more minions
18.73
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Key Concepts
•
Pods: Smallest deployable unit that can be created, scheduled, managed (logical collection of containers)
•
Master: Central point that provides unified view of cluster, control one or more minions
•
Minion: Run tasks from master
18.74
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Kubernetes
Master
Minion
Container
Pod
Container
Container
Pod
Container
Container
Pod
Container
Docker
Minion
Container
Pod
Container
Container
Pod
Container
Container
Pod
Container
Docker
Minion
Container
Pod
Container
Container
Pod
Container
Container
Pod
Container
Docker
18.75
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
kubectl
18.76
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
kubectl
•
Controls the Kubernetes cluster manager
18.77
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
kubectl
•
Controls the Kubernetes cluster manager
•
kubectl get pods or minions
18.78
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
kubectl
•
Controls the Kubernetes cluster manager
•
kubectl get pods or minions
•
kubectl create -f <filename>
18.79
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
kubectl
•
Controls the Kubernetes cluster manager
•
kubectl get pods or minions
•
kubectl create -f <filename>
•
lubectl update or delete
18.80
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
kubectl
•
Controls the Kubernetes cluster manager
•
kubectl get pods or minions
•
kubectl create -f <filename>
•
lubectl update or delete
•
kubectl resize —replicas=3 replicationcontrollers <name>
18.81
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Kubernetes Config
{
"id": "mysql",
"kind": "Pod", "apiVersion": "v1beta1", "desiredState": {
"manifest": { "version": "v1beta1", "id": "mysql",
"containers": [{
"name": "mysql",
"image": "mysql", "cpu": 100,
"ports": [{
3306,
"containerPort": "hostPort": 3306
}]
}]
}
},
"labels": {
"name": "mysql"
}
}
18.82
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Kubernetes Config
{ | | | { | |
| "id": "mysql", | | | "id": "wildfly", |
| "kind": "Pod", | | | "kind": "Pod", |
| "apiVersion": "v1beta1", | | | "apiVersion": "v1beta1", |
| "desiredState": { | | | "desiredState": { |
| "manifest": { | | | "manifest": { |
| "version": "v1beta1", | | | "version": "v1beta1", |
| "id": "mysql", | | | "id": "wildfly", |
| "containers": [{ | | | "containers": [{ |
| "name": "mysql", | | | "name": "wildfly", |
| "image": "mysql", | | | "image": "jboss/wildfly", |
| "cpu": 100, | | | "cpu": 100, |
| "ports": [{ | | | "ports": [{ |
| "containerPort": | 3306, | | "containerPort": 8080, |
| "hostPort": 3306 | | | "hostPort": 8080 |
| }] | | | }] |
| }] | | | }] |
| } | | | } |
| }, | | | }, |
| "labels": { | | | "labels": { |
| "name": "mysql" | | | "name": "wildfly" |
| } | | | } |
} | | | } | |
18.83
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Microservices
building applications as suites of services. As well as the fact that services are independently deployable and scalable, each service also provides a firm module boundary, even allowing for different services to be written in different programming languages. They can also be managed by different teams
18.84
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Is it SOA?
•
SOA for hipsters?
•
Fine-grained SOA?
•
Focus on ESBs in SOA?
•
SOA done right?
18.85
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Monolith Application
UI
Database
Business Logic
18.86
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Monolith Application
UI
Database
Business Logic
HTML
HTML
HTML
CSS
CSS
18.87
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Monolith Application
UI
Business Logic
HTML
HTML
HTML
CSS
CSS
HTML
HTML
Database
JPA
18.88
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Monolith Application
UI
Database
Business Logic
HTML
HTML
HTML
CSS
CSS
HTML
HTML
CDI
HTML
HTML
REST
HTML
HTML
JSF
HTML
HTML
JPA
Cache
DB
18.89
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Monolith Application
UI
Database
Business Logic
HTML
HTML
HTML
CSS
CSS
HTML
HTML
CDI
HTML
HTML
REST
HTML
HTML
JSF
HTML
HTML
JPA
Cache
DB
18.90
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Monolith Application
UI
Database
Business Logic
HTML
HTML
HTML
CSS
CSS
HTML
HTML
CDI
HTML
HTML
REST
HTML
HTML
JSF
HTML
HTML
JPA
Load Balancer
Cache
DB
18.91
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Before Microservices
WAR
WAR
JAR
JAR
JAR
EAR
WAR
JAR
18.92
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Before Microservices
WAR
Cache
WAR
JAR
JAR
JAR
EAR
WAR
JAR
18.93
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Before Microservices
WAR
Cache
WAR
JAR
JAR
JAR
EAR
WAR
JAR
DB
18.94
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Before Microservices
WAR
Cache
WAR
JAR
JAR
JAR
EAR
WAR
JAR
DB
18.95
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Before Microservices
WAR
Cache
Load Balancer
WAR
JAR
JAR
JAR
EAR
WAR
JAR
DB
18.96
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of Monolith Application
18.97
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of Monolith Application
•
Typically packaged in a single .ear
18.98
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of Monolith Application
•
Typically packaged in a single .ear
•
Simple to develop/deploy
18.99
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of Monolith Application
•
Typically packaged in a single .ear
•
Simple to develop/deploy
•
Easy to test (all required services are up)
18.100
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Disadvantages of Monolith Application
18.101
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Disadvantages of Monolith Application
•
Difficult to develop and maintain
18.102
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Disadvantages of Monolith Application
•
Difficult to develop and maintain
•
Obstacle to frequent deployments
18.103
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Disadvantages of Monolith Application
•
Difficult to develop and maintain
•
Obstacle to frequent deployments
•
Makes it difficult to try out new technologies/ framework
18.104
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Monolith Application
UI
Database
Business Logic
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
Version 1
18.105
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Monolith Application
UI
Database
ness Logic
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
Version 1
UI
Database
Busi
Business Logic
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
Version 2
18.106
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Monolith Application
UI
Database
ness Logic
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
Version 1
UI
Database
ess Logic
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
Version 2
UI
Database
Busi
Busin
Business Logic
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
Version 3
18.107
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Monolith Application
UI
Database
Busi
ness Logic
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
Version 1
UI
Database
Busin
ess Logic
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
Version 2
UI
Database
ess Logic
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
Version 3
UI
Database
Busin
Business Logic
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
HTML
Version 4
18.108
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
18.109
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Characteristics of µservices
18.110
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Characteristics of µservices
18.111
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Characteristics of µservices
18.112
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Characteristics of µservices
18.113
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Characteristics of µservices
18.114
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Characteristics of µservices
18.115
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Characteristics of µservices
18.116
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Characteristics of µservices
18.117
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Characteristics of µservices
18.118
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Scaling µservices
18.119
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Strategies for decomposing
18.120
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Strategies for decomposing
•
Verb or usecase - e.g. Checkout UI
18.121
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Strategies for decomposing
•
Verb or usecase - e.g. Checkout UI
•
Noun - e.g. Catalog product service
18.122
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Strategies for decomposing
•
Verb or usecase - e.g. Checkout UI
•
Noun - e.g. Catalog product service
•
Single Responsible Principle - e.g. Unix utilities
18.123
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Towards µservices
Service A
EAR
WAR
WAR
WAR
JAR
JAR
JAR
JAR
18.124
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Towards µservices
Service A
EAR
WAR
DB
WAR
WAR
JAR
JAR
JAR
JAR
18.125
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Towards µservices
Service A
EAR
WAR
DB
WAR
WAR
JAR
JAR
JAR
JAR
DB
Cache
18.126
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Towards µservices
Service A
EAR
WAR
DB
WAR
WAR
JAR
JAR
JAR
JAR
DB
Cache
18.127
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Towards µservices
Service A
EAR
WAR
DB
WAR
WAR
JAR
JAR
JAR
JAR
DB
Cache
18.128
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Towards µservices
Service A
EAR
WAR
DB
Load Balancer
WAR
WAR
JAR
JAR
JAR
JAR
DB
Cache
18.129
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Aggregator Pattern #1
Service C
WAR
Service B
WAR
Service A
WAR
18.130
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Aggregator Pattern #1
Service C
WAR
Service B
WAR
DB
Cache
Service A
WAR
DB
Cache
DB
Cache
18.131
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Aggregator Pattern #1
Service C
WAR
Service B
WAR
DB
Cache
Service A
WAR
DB
Cache
DB
Cache
Aggregator
Load Balancer
18.132
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Aggregator Pattern #1
Service C
WAR
Service B
WAR
DB
Cache
Service A
WAR
DB
Cache
DB
Cache
Aggregator
Load Balancer
18.133
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Aggregator Pattern #1
Service C
WAR
Service B
WAR
DB
Cache
Service A
WAR
DB
Cache
DB
Cache
Aggregator
Load Balancer
18.134
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Proxy Pattern #1.5
Service C
WAR
Service B
WAR
DB
Cache
Service A
WAR
DB
Cache
DB
Cache
Proxy
Load Balancer
18.135
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Proxy Pattern #1.5
Service C
WAR
Service B
WAR
DB
Cache
Service A
WAR
DB
Cache
DB
Cache
Proxy
Load Balancer
18.136
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Proxy Pattern #1.5
Service C
WAR
Service B
WAR
DB
Cache
Service A
WAR
DB
Cache
DB
Cache
Proxy
Load Balancer
18.137
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Chained Pattern #2
Service A
WAR
DB
Cache
Load Balancer
18.138
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Chained Pattern #2
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
18.139
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Chained Pattern #2
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
Service C
WAR
DB
Cache
18.140
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Branch Pattern #3
Service A
WAR
DB
Cache
Load Balancer
18.141
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Branch Pattern #3
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
18.142
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Branch Pattern #3
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
Service C
WAR
DB
Cache
18.143
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Branch Pattern #3
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
Service C
WAR
DB
Cache
Service D
WAR
DB
Cache
18.144
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Shared Resources #4
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
Service C
WAR
DB
Cache
Service D
WAR
DB
Cache
18.145
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Shared Resources #4
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
Service C
WAR
DB
Cache
Service D
WAR
18.146
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Shared Resources #4
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
Service C
WAR
DB
Cache
Service D
WAR
18.147
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Shared Resources #4
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
Service C
WAR
DB
Cache
Service D
WAR
18.148
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Shared Resources #4
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
Service C
WAR
DB
Cache
Service D
WAR
18.149
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Async Messaging #5
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
Service C
WAR
DB
Cache
Service D
WAR
DB
Cache
Queue
18.150
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Async Messaging #5
Service A
WAR
DB
Cache
Load Balancer
Service B
WAR
DB
Cache
Service C
WAR
DB
Cache
Service D
WAR
DB
Cache
Queue
18.151
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Decentralized data
18.152
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Decentralized data
•
Each service has it owns schema, loose coupling
18.153
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Decentralized data
•
Each service has it owns schema, loose coupling
•
Polyglot persistence
18.154
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Decentralized data
•
Each service has it owns schema, loose coupling
•
Polyglot persistence
•
Distributed transactions reduces system availability
18.155
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Decentralized data
•
Each service has it owns schema, loose coupling
•
Polyglot persistence
•
Distributed transactions reduces system availability
•
Event-driven asynchronous updates
18.156
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Decentralized data
•
Each service has it owns schema, loose coupling
•
Polyglot persistence
•
Distributed transactions reduces system availability
•
Event-driven asynchronous updates
18.157
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Decentralized data
•
Each service has it owns schema, loose coupling
•
Polyglot persistence
•
Distributed transactions reduces system availability
•
Event-driven asynchronous updates
18.158
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Decentralized data
•
Each service has it owns schema, loose coupling
•
Polyglot persistence
•
Distributed transactions reduces system availability
•
Event-driven asynchronous updates
18.159
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Event-driven async updates
Service A
WAR
DB
Cache
Message Broker
Service B
WAR
DB
Cache
18.160
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of µservices
18.161
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of µservices
18.162
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of µservices
18.163
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of µservices
18.164
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of µservices
18.165
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of µservices
18.166
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of µservices
18.167
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Advantages of µservices
18.168
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Drawbacks of µservices
18.169
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Drawbacks of µservices
•
Additional complexity of distributed systems
18.170
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Drawbacks of µservices
•
Additional complexity of distributed systems
•
Significant operational complexity, need high-level of automation
18.171
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Drawbacks of µservices
•
Additional complexity of distributed systems
•
Significant operational complexity, need high-level of automation
•
Rollout plan to coordinate deployments
18.172
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Drawbacks of µservices
•
Additional complexity of distributed systems
•
Significant operational complexity, need high-level of automation
•
Rollout plan to coordinate deployments
•
Slower ROI, to begin with
18.173
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition
Docker and Kubernetes are well suited to create a µservices-based application.
18.174
Silberschatz, Galvin and Gagne ©2018
Operating System Concepts – 10th Edition