Mircroservices
Docker
Architecture
Internals
Why Docker for
Microservices
Docker
Orchestration
Microservices are an approach to developing a
single application as a suite of small,
connected, services (Martin Fowler)
Microservices are loosely coupled service
orientated architecture with bounded contexts
(Adrian Cockcroft)
Microservices are small automonous services
that work well together (Sam Newman)
Break big application down into many small services
http://martinfowler.com/microservices/
@crichardson
Intimidates developers
@cr
Lo t s o f co o r d i n at i o n a n d
co m m u n i cat i o n r equ i r ed
Obstacle to scaling
development
I want
to update the UI
But
the backend is not working
yet!
@crichardson
Requires long-term commitment
to a technology stack
@
Overloads your IDE and
container
Sl o ws d o w n d ev el o pm en t
 Componentization via Services
 Organized around Business Capabilities
 Products not Projects
 Smart endpoints and dumb pipes
 Decentralized Governance
 Decentralized Data Management
 Infrastructure Automation
 Design for failure
 Evolutionary Design
http://martinfowler.com/microservices/
 Use different stacks for different services
 Replace or refactor individual services easily
 Less coordination required when deploying
 deploy more often
 less risk
 more agility and speed
 Promotes many small teams instead of one
big army
 Enables effective ownership of services
http://microservices.io/patterns/microservices.html
Easily try other technologies
... an d f ai l saf el y
“Automates the deployment of any
application as a lightweight, portable,
self-sufficient container
that will run virtually anywhere”
 Faster delivery of your applications
 Deploying and scaling more easily
 Achieving higher density and running more workloads
 Portable deployment across machines
 Versioning
 Component reuse
 Shared libraries
Quick Demo….
Pull the image from Docker Repository
docker pull sequenceiq/spark:1.4.0
Building the image
docker build --rm -t sequenceiq/spark:1.4.0 .
Running the image
docker run -it -p 8088:8088 -p 8042:8042 -h sandbox sequenceiq/spark:1.4.0 bash
FROM java:7
MAINTAINER nvn_ravi@hotmail.com
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
RUN javac Main.java
CMD ["java", "Main"]
 ProvisionContainers
 ManageContainer Dependencies
 Enable Discovery
 Handle Container Failure
 Scale Containers
Amazon ECS
 Describe a stack of containers in a simple
YAML file
 Start the stack with a single command
 Compose connects containers together
with links
 Also provides simple scaling and log
aggregation
Master
Minion
pod pod
labels labels
kubelet cAdvisor proxy
API Server
Minion
pod pod
labels labels
kubelet cAdvisor proxy
scheduler
replication
controller
kubectl
distributed
storage
Microservices with Docker
Microservices with Docker
Microservices with Docker
Microservices with Docker
Microservices with Docker