Post on 26-Jan-2017
Docker + MongoDB Alvin Richards, Enterprise Products Lead alvin@docker.com @jonnyeight
Part One – What is Docker?
Docker Mission – Make the Internet Programmable
3
Build Ship Run
Open Standards
Plumbing
Pla6orm
Solu8ons
Engine Machine Compose Swarm
Distribution
Image spec Container run-time spec
RunC
Notary
Docker Trusted Registry
Project "Orca"
Open Container Ini-a-ve
RunC
notary 4
Open Standards & Plumbing
Open Container Initiative (OCI)
Coalition of industry leaders join forces to eliminate fragmentation • Form a vendor-neutral, open source governance model under the Linux
Foundation • Establish common standards for container format and runtime • Docker donated its container format, runtime and associated specifications • Appoint maintainers for the libcontainer project
5
h3p://www.opencontainers.org/
Networking
Plugins
Orchestra-on 6
Docker Platform
Networking
8
Before
• Inflexible • Single host • Limited to one network
X
• Container SDN • Distributed networking • Portable across networks • Plug ins to broad ecosystem
ABer
Plugins Pluggable Architecture to extend Docker functionality • Introducing Networking and Volume plugins • For Users: Portability and choice for developers and ops • For Partners: Easily integrate and access Docker users • Collaboration with Cluster HQ, Glider Labs, Weave
9
Networking
Volumes
Docker Engine Plug ins
> docker
Docker client
Orchestration Across the App Lifecycle
Docker Machine
Docker Swarm
Docker Compose 10
Docker Compose and Swarm • Consistent developer experience with flexible Swarm backends • Integrated with Docker Networking • Mesos backend beta available • Amazon ECS backend collaboration WIP
11
docker
Docker client
Coming Soon!
Running Docker in Production
Three Key Use Cases
Produc-on Requirements
Commercial Availability 12
Continuous Integration and Delivery
13
Developer
Version control
1. Development 2. Test 3. Stage / Produc-on
QA / QE
Sysadmin
Video from DockerCon
Containers as a Service Developer Sysadmin
DevOps
Tomcat
Jenkins
MongoDB Deployment
Video from DockerCon
SysAdmins DBAs
Data Processing Pipelines
Data Scientist
$ docker
Data Nodes
Video from DockerCon
Docker Enterprise Solutions
16
Server or Cloud Hosted Registry
Docker Engine
Stable Secure Responsive
Docker Trusted Registry
Docker Hub
or
Commercial Subscruption
Get it here!
Part Two: Development through to Production • Build & Run an App in Development
– Python + MongoDB • Deploy to a Swarm cluster in Production
– Scale Web services • Deploy new MongoDB Cluster in Production
Lets build an App!
19
web
mongodb
Development
python / flask
Scale in Production
20
web2 web3 web4 webN
mongos cfg3 cfg2 cfg1
web web1
mongodb
Development
…
Production
HA Proxy
rs1a
rs1b
rs1c
rs2a
rs2b
rs2c
Demo 1 : Build an App
21
Roll the App to Production behind HA Proxy
22
web web1
Development Production
mongodb
HA Proxy
mongodb
Scale the web tier
23
web2 web3 web4 webN web web1
mongodb
Development
…
Production
mongodb
HA Proxy
Demo 2 : Scale the Web Tier
24
Deploy a sharded cluster
25
web2 web3 web4 webN
mongos cfg3 cfg2 cfg1
web web1
mongodb
Development
…
Production
mongodb
HA Proxy
rs1a
rs1b
rs1c
rs2a
rs2b
rs2c
Migrate to the new cluster
27
web2 web3 web4 webN
mongos cfg3 cfg2 cfg1
web web1
mongodb
Development
…
Production
mongodb
HA Proxy
rs1a
rs1b
rs1c
rs2a
rs2b
rs2c
Demo 3 : Scale the Database
28
Storage: Inside or outside the container?
Inside • Encapsulation of Concerns
29
Host
daemon
container
Host
daemon
container e.g. SSD
e.g. EBS
Outside • Separation of concerns • Storage Features (e.g. snapshots)
/data/db /mnt/xx:/data/db
Summary
• Define Container, their contents and how they work together once • Deploy the same images in Dev, Pre-‐Prod and Produc-on across PlaZorms
One solu-on from Dev -‐> Produc-on
• Ops define the whitelisted images, security policies etc. • Dev use approved images to build upon • Eliminate the complexity (and cost) of deployment
Running Docker & MongoDB in Produc-on
30
Thanks and Q&A • Code
– https://github.com/alvinr/docker-demo/tree/master/dockercon15demo
• alvin@docker.com • @jonnyeight
31