SlideShare a Scribd company logo
#MDBW17
Andrew Morgan – MongoDB Product Marketing
POWERING MICROSERVICES
WITH DOCKER, KUBERNETES,
KAFKA, & MONGODB
andrewmorgan
#MDBW17
AGENDA
Microservice
s
What, Why,
How?
Containers
Docker, Kafka
Orchestratio
n
Kubernetes,
Mesos, …
MongoDB
Why, How?
When to use Use cases
Who, Why?
1 2 3 4 5 6
MICROSERVICES
#MDBW17
WHY USE MICROSERVICES? (TL;DR
WEBSCALE)
Speed Change Maintain Scale Empower
Build MVP quickly Rapid iterations Simple components Product Team == Component
React to market Isolated impact Team Committees
#MDBW17
WHY USE MICROSERVICES? (TL;DR
WEBSCALE)
Speed Change Maintain Scale Empower
Build MVP quickly Rapid iterations Simple components Product Team == Component
React to market Isolated impact Team Committees
#MDBW17
WHY USE MICROSERVICES? (TL;DR
WEBSCALE)
Speed Change Maintain Scale Empower
Build MVP quickly Rapid iterations Simple components Product Team == Component
React to market Isolated impact Team Committees
#MDBW17
WHY USE MICROSERVICES? (TL;DR
WEBSCALE)
Speed Change Maintain Scale Empower
Build MVP quickly Rapid iterations Simple components Product Team == Component
React to market Isolated impact Team Committees
#MDBW17
WHY USE MICROSERVICES? (TL;DR
WEBSCALE)
Speed Change Maintain Scale Empower
Build MVP quickly Rapid iterations Simple components Product Team == Component
React to market Isolated impact Team Committees
#MDBW17
WHY USE MICROSERVICES? (TL;DR
WEBSCALE)
Speed Change Maintain Scale Empower
Build MVP quickly Rapid iterations Simple components Product Team == Component
React to market Isolated impact Team Committees
#MDBW17
Monolithic
Cross-Team
Tight Coupling
Small
Change
Huge
Impact
System
Retests
#MDBW17
Microservices
Decoupled
Independent
Dev
Isolated
Impact
#MDBW17
MICROSERVICES EXAMPLE
Twitter
IngestGoogle+
Ingest
Snapcha
t Ingest
Feed
merge
Faceboo
k Ingest
#MDBW17
MICROSERVICES EXAMPLE
Twitter
Ingest
Snapcha
t Ingest
Feed
merge
Faceboo
k Ingest
#MDBW17
MICROSERVICES EXAMPLE
Twitter
Ingest
Snapcha
t Ingest
Feed
merge
Faceboo
k Ingest
#MDBW17
MICROSERVICES EXAMPLE
Twitter
Ingest
Snapcha
t Ingest
Feed
merge
Faceboo
k Ingest
Whatsap
p Ingest
#MDBW17
MICROSERVICES EXAMPLE
Twitter
Ingest
Snapcha
t Ingest
Feed
merge
Faceboo
k Ingest
Whatsap
p Ingest
Snapcha
t Ingest
Snapcha
t Ingest
#MDBW17
DEVELOPMENT TEAMS
CONTAINERS
#MDBW17
CONTAINERS – POWERING
MICROSERVICES
Real world shipping containers
• Road, rail & sea
• Contents untouched
• Ubiquitous & standardized
• Simple
• Contents protected
• Constraints
#MDBW17
CONTAINERS – POWERING
MICROSERVICES
Software containers
• 1 image -> Many containers
‒ Laptop, DC, cloud
‒ Dev, QA, production, support
• Simple, efficient
• Isolation
• Constraints
#MDBW17
VMS VS. CONTAINERS
VM VMVM
Bare Metal
Host Operating System
Hypervisor
Guest OS
Libraries
Apps
Service
Guest OS
Libraries
Apps
Service
Guest OS
Libraries
Apps
Service
Container ContainerContainer
Bare Metal
Host Operating System
Docker Engine
Libraries
Libraries
Apps
Libraries
Apps
Service ServiceService
#MDBW17
VMS VS. CONTAINERS
VM VMVM
Bare Metal
Host Operating System
Hypervisor
Guest OS
Libraries
Apps
Service
Guest OS
Libraries
Apps
Service
Guest OS
Libraries
Apps
Service
Container ContainerContainer
Bare Metal
Host Operating System
Docker Engine
Libraries
Libraries
Apps
Libraries
Apps
Service ServiceService
#MDBW17
VMS VS. CONTAINERS
VM VMVM
Bare Metal
Host Operating System
Hypervisor
Guest OS
Libraries
Apps
Service
Guest OS
Libraries
Apps
Service
Guest OS
Libraries
Apps
Service
Container ContainerContainer
Bare Metal
Host Operating System
Docker Engine
Libraries
Libraries
Apps
Libraries
Apps
Service ServiceService
#MDBW17
DOCKER
• Simple to use
• 100K+ images on Docker Hub
• Build images from images
• Platforms
‒ Linux, OS X, Windows
‒ Laptop, VM, Cloud,…
‒ Cloud services
#MDBW17
RUN MONGODB
docker run -d mongo
#MDBW17
TITLE ONLY
#MDBW17
TITLE ONLY
#MDBW17
MICROSERVICE ARCHITECTURES BUILT ON
CONTAINERS
Many small, focused containers ->
sophisticated services
• Well defined APIs
• Independent languages &
libraries
• Modular: easy maintenance +
reuse
• Fault tolerant
• Scalable
#MDBW17
CONNECTING THE MICROSERVICES –
KAFKA
Producer
9
8
7
123...
Topic A
Consumer
#MDBW17
CONNECTING THE MICROSERVICES –
KAFKA
Producer
9
8
7
123...
Topic A
Consumer
Producer Consumer
#MDBW17
CONNECTING THE MICROSERVICES –
KAFKA
Producer
9
8
7
123...
Partition 0
Topic A
Consumer
Producer Consumer
4
3
5
123...
Partition 1
#MDBW17
CONNECTING THE MICROSERVICES –
KAFKA
Producer
LEADER
Topic A / Partition 0
Broker 1
FOLLOWER
Topic A / Partition 1
FOLLOWER
Topic A / Partition 0
Broker 2
LEADER
Topic A / Partition 1
#MDBW17
CONNECTING THE MICROSERVICES –
KAFKA
Producer
Producer
Producer
9
8
7
123
...
Partition 0
4
3
5
123
...
Partition 1
7
3
2
123
...
Partition N
Topic A
Topic B
7
6
5
123
...
Partition 0
New  Old
Consumer
Consumer
ORCHESTRATION
#MDBW17
ORCHESTRATION
Automated deployment, connecting,
and maintenance of multiple
containers
• Provision hosts
• Containers
‒ Instantiate
‒ Reschedule
‒ Link
‒ Scale Out/In
• Expose services
#MDBW17
KUBERNETES
Created by Google, feature-rich and
widely adopted
• Deployment and ‘replication’
• On-line scale out/in
• Rolling upgrades
• High Availability
• Persistence
• Ports
• Load balancing
• Google Compute Engine
#MDBW17
APACHE MESOS
10,000s of physical servers; used by
Twitter, Airbnb & Apple
• Code (“frameworks) vs.
declarative
• Less feature rich than Kubernetes
• Kubernetes as a Mesos
framework
• Foundation for distributed systems
‒ Apache Aurora, Chronos, Marathon
#MDBW17
CHOOSING AN ORCHESTRATION
FRAMEWORK
• What you have:
‒ Skills?
‒ DevOps frameworks?
‒ Number of hosts?
‒ Bare metal, VMs, or cloud?
• Lifecycle
• Features
‒ Automated High Availability?
‒ Grouping and load balancing?
‒ As a service?
MONGODB
#MDBW17
WHY MONGODB IS A GOOD FIT FOR
MICROSERVICES
Monitoring
&
Automation
Flexible Data
Model
Redundancy Scalability Simplicity
#MDBW17
WHY MONGODB IS A GOOD FIT FOR
MICROSERVICES
Monitoring
&
Automation
Flexible Data
Model
Redundancy Scalability Simplicity
#MDBW17
WHY MONGODB IS A GOOD FIT FOR
MICROSERVICES
Monitoring
&
Automation
Flexible Data
Model
Redundancy Scalability Simplicity
#MDBW17
WHY MONGODB IS A GOOD FIT FOR
MICROSERVICES
Monitoring
&
Automation
Flexible Data
Model
Redundancy Scalability Simplicity
#MDBW17
WHY MONGODB IS A GOOD FIT FOR
MICROSERVICES
Monitoring
&
Automation
Flexible Data
Model
Redundancy Scalability Simplicity
#MDBW17
WHY MONGODB IS A GOOD FIT FOR
MICROSERVICES
Monitoring
&
Automation
Flexible Data
Model
Redundancy Scalability Simplicity
#MDBW17
ORCHESTRATING MONGODB USING
KUBERNETES
Distributed, stateful application
• Persistent volumes
• External IP addresses for internal
comms
• Init MongoDB replica set
• Monitor
• Backup
Volume
name:
mongo-persistent-storage1
pdName: mongodb-disk1
mongodb
-disk1
Container
name: mongo-node1
image: mongo
command: mongod –replSet my_replica_set
containerPort: 27017
volumeMounts:
name: mongo-persistent-storage1
mountPath: /data/db
Docker Hub Registry
Pod
labels: [name: mongo-node1; instance: rod]
ReplicationController
name: mongo-rc1
labels: [name: mongo-rc]
replicas: 1
selector: [name: mongo -node1]
Service: LoadBalancer
name: mongo-svc-a
labels: [name: mongo-svc-a]
ports: [port: 27017, targetPort: 27017]]
selector: [name: mongo-node, instance: rod]
ExternalIP
Address
104.1.1.1
App
104.1.1.1:27017
ReplicationControler
name: mongo-rc-europe
labels: [name: mongo-europe]
replicas: 1
selector: [name: mongo -node]
Volume
name:
mongo-persistent-storage
pdName: mongodb-disk-europe
mongodb-
disk-europe
Container
name: mongo-node
image: mongo
command: mongod –replSet my_replica_set
containerPort: 27017
volumeMounts:
name: mongo-persistent-storage
mountPath: /data/db
Pod
labels: [name: mongo-node]
Service: LoadBalancer
name: mongo-svc-europe
labels: [name: mongo-svc-europe]
ports: [port: 27017, targetPort: 27017]]
selector: [name: mongo-node]
ReplicationControler
name: mongo-rc-asia
labels: [name: mongo-asia]
replicas: 1
selector: [name: mongo -node]
Volume
name:
mongo-persistent-storage
pdName: mongodb-disk-asia
mongodb-
disk-asia
Container
name: mongo-node
image: mongo
command: mongod –replSet my_replica_set
containerPort: 27017
volumeMounts:
name: mongo-persistent-storage
mountPath: /data/db
Pod
labels: [name: mongo-node]
Service: LoadBalancer
name: mongo-svc-asia
labels: [name: mongo-svc-asia]
ports: [port: 27017, targetPort: 27017]]
selector: [name: mongo-node]
ReplicationControler
name: mongo-rc-us
labels: [name: mongo-us]
replicas: 1
selector: [name: mongo -node]
Volume
name:
mongo-persistent-storage
pdName: mongodb-disk-us
mongodb-
disk-us
Container
name: mongo-node
image: mongo
command: mongod –replSet my_replica_set
containerPort: 27017
volumeMounts:
name: mongo-persistent-storage
mountPath: /data/db
Pod
labels: [name: mongo-node]
Service: LoadBalancer
name: mongo-svc-us
labels: [name: mongo-svc-us]
ports: [port: 27017, targetPort: 27017]]
selector: [name: mongo-node]
#MDBW17
STATEFULSETS
Beta in Kubernetes 1.5/6
• Stable, predictable, unique
network identifiers.
‒ IP addresses may change
• Stable, persistent storage
• Ordered, graceful deployment and
scaling (0 N-1)
• Ordered, graceful deletion and
termination (N-1  0)
WHEN TO USE
MICROSERVICES
#MDBW17
WHEN TO USE MICROSERVICES
USE CASES
#MDBW17
MONGODB & MICROSERVICES IN THE WILD
#MDBW17
REFERENCES
• Enabling Microservices – Containers & Orchestration Explained
https://www.mongodb.com/collateral/microservices-containers-and-orchestration-explained
• Microservices: The Evolution of Building Modern Applications
https://www.mongodb.com/collateral/microservices-the-evolution-of-building-modern-
applications
• Data Streaming with Apache Kafka & MongoDB
https://www.mongodb.com/collateral/data-streaming-with-apache-kafka-and-mongodb
#MDBW17
RUNNING MONGODB AS A MICROSERVICE
Powering Microservices with Docker, Kubernetes, Kafka, and MongoDB
Conway’s Law
1967
Any organization that designs a system will
inevitably produce a design whose structure
is a copy of the organization's
communication structure.”
#MDBW17
ALTERNATE MICROSERVICES EXAMPLE
• Much larger Microservices
1. User Account
2. Product Catalog
3. Inventory
4. Orders
• Best practice is each
microservice has its own
database
#MDBW17
SECURITY
Opportunities
• Isolation
• Constrain resources
• Narrow roles
• Keep images/containers current
• root: so restrict access

More Related Content

What's hot (20)

PPTX
Scaling MongoDB to a Million Collections
MongoDB
 
PDF
Engineering an Encrypted Storage Engine
MongoDB
 
PPTX
Sizing MongoDB Clusters
MongoDB
 
PDF
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
MongoDB
 
PPTX
Accelerating the Path to Digital with a Cloud Data Strategy
MongoDB
 
PPTX
Introducing Stitch
MongoDB
 
PDF
Mongo DB Monitoring - Become a MongoDB DBA
Severalnines
 
PDF
MongoDB .local Bengaluru 2019: The Journey of Migration from Oracle to MongoD...
MongoDB
 
PDF
MongoDB WiredTiger Internals
Norberto Leite
 
PDF
An Elastic Metadata Store for eBay’s Media Platform
MongoDB
 
PPTX
Redis Labs and SQL Server
Lynn Langit
 
PPTX
MongoDB Internals
Siraj Memon
 
PDF
MySQL Cluster (NDB) - Best Practices Percona Live 2017
Severalnines
 
PPTX
Webinar: Architecting Secure and Compliant Applications with MongoDB
MongoDB
 
PPTX
Building the Real-Time Performance Panel
MongoDB
 
PPTX
Let the Tiger Roar! - MongoDB 3.0 + WiredTiger
Jon Rangel
 
PDF
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
Severalnines
 
PPTX
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
MongoDB
 
PPTX
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
Andrew Morgan
 
PPTX
Concurrency Control in MongoDB 3.0
MongoDB
 
Scaling MongoDB to a Million Collections
MongoDB
 
Engineering an Encrypted Storage Engine
MongoDB
 
Sizing MongoDB Clusters
MongoDB
 
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
MongoDB
 
Accelerating the Path to Digital with a Cloud Data Strategy
MongoDB
 
Introducing Stitch
MongoDB
 
Mongo DB Monitoring - Become a MongoDB DBA
Severalnines
 
MongoDB .local Bengaluru 2019: The Journey of Migration from Oracle to MongoD...
MongoDB
 
MongoDB WiredTiger Internals
Norberto Leite
 
An Elastic Metadata Store for eBay’s Media Platform
MongoDB
 
Redis Labs and SQL Server
Lynn Langit
 
MongoDB Internals
Siraj Memon
 
MySQL Cluster (NDB) - Best Practices Percona Live 2017
Severalnines
 
Webinar: Architecting Secure and Compliant Applications with MongoDB
MongoDB
 
Building the Real-Time Performance Panel
MongoDB
 
Let the Tiger Roar! - MongoDB 3.0 + WiredTiger
Jon Rangel
 
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
Severalnines
 
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
MongoDB
 
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
Andrew Morgan
 
Concurrency Control in MongoDB 3.0
MongoDB
 

Similar to Powering Microservices with Docker, Kubernetes, Kafka, and MongoDB (20)

PDF
MongoDB Europe 2016 - Powering Microservices with Docker, Kubernetes, and Kafka
MongoDB
 
PPTX
Powering Microservices with Docker, Kubernetes, Kafka, & MongoDB
MongoDB
 
PDF
MongoDB World 2016: Scaling MongoDB with Docker and cGroups
MongoDB
 
PDF
Scaling MongoDB with Docker and cgroups
marcoita
 
PPTX
Powering Microservices with Docker, Kubernetes, Kafka, and MongoDB
MongoDB
 
PPTX
SH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptx
MongoDB
 
PPTX
Microservices: Living Large in Your Castle Made of Sand
MongoDB
 
PPTX
The rise of microservices - containers and orchestration
Andrew Morgan
 
PPTX
Jumpstart: Your Introduction to MongoDB
MongoDB
 
PDF
Building Your Own MongoDB as a Service Offering
MongoDB
 
PDF
MongoDB Europe 2016 - MongoDB Atlas
MongoDB
 
PPTX
Enterprise Trends for MongoDB as a Service
MongoDB
 
PPTX
Introduction to micro-services @DevOps pune Meetup
Rahul Khengare
 
PPTX
The Rise of Microservices - Containers and Orchestration
MongoDB
 
PDF
Microservices at scale with docker and kubernetes - AMS JUG 2017
Arjen Wassink
 
PDF
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
SlideTeam
 
PPTX
Faster, Simpler, Better - MongoDB to the rescue
MongoDB
 
PPTX
Microservices, Containers, Scheduling and Orchestration - A Primer
Gareth Llewellyn
 
PPTX
Webinar: Enterprise Trends for Database-as-a-Service
MongoDB
 
PPTX
Docker-N-Beyond
santosh007
 
MongoDB Europe 2016 - Powering Microservices with Docker, Kubernetes, and Kafka
MongoDB
 
Powering Microservices with Docker, Kubernetes, Kafka, & MongoDB
MongoDB
 
MongoDB World 2016: Scaling MongoDB with Docker and cGroups
MongoDB
 
Scaling MongoDB with Docker and cgroups
marcoita
 
Powering Microservices with Docker, Kubernetes, Kafka, and MongoDB
MongoDB
 
SH 1 - SES 4 - Microservices - Andrew Morgan TLV.pptx
MongoDB
 
Microservices: Living Large in Your Castle Made of Sand
MongoDB
 
The rise of microservices - containers and orchestration
Andrew Morgan
 
Jumpstart: Your Introduction to MongoDB
MongoDB
 
Building Your Own MongoDB as a Service Offering
MongoDB
 
MongoDB Europe 2016 - MongoDB Atlas
MongoDB
 
Enterprise Trends for MongoDB as a Service
MongoDB
 
Introduction to micro-services @DevOps pune Meetup
Rahul Khengare
 
The Rise of Microservices - Containers and Orchestration
MongoDB
 
Microservices at scale with docker and kubernetes - AMS JUG 2017
Arjen Wassink
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
SlideTeam
 
Faster, Simpler, Better - MongoDB to the rescue
MongoDB
 
Microservices, Containers, Scheduling and Orchestration - A Primer
Gareth Llewellyn
 
Webinar: Enterprise Trends for Database-as-a-Service
MongoDB
 
Docker-N-Beyond
santosh007
 
Ad

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 
Ad

Recently uploaded (20)

PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Digital Circuits, important subject in CS
contactparinay1
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 

Powering Microservices with Docker, Kubernetes, Kafka, and MongoDB

Editor's Notes

  • #4: 1 + 8 Microservice architectures implement applications as a series of small, self-contained, loosely coupled software components. Each has a specific and well understood role.
  • #11: Spaghetti Code Reverse engineer? No one understands entire code base Change one line of code, impacts scores of other, unexpected places Monolith is like Spaghetti Changing anything impacts everything else. <= 1990s Pre-SOA (monolithic) Tight coupling For a monolith to change, all must agree on each change. Each change has unanticipated effects requiring careful testing beforehand
  • #12: Add a new flavor independently. Chef making chocolate knows that well but need not know the others Blueberry goes out of fashion, remove them Need more green cakes, add them Improved pink frosting, throw out the old ones and the new ones. Microservices are like Cupcakes Can add new ones with different flavors, remove ones that you no longer need, add more pink ones if there’s greater demand Developers can create and activate new microservices without prior coordination with others. Their adherence to MSA principles makes continuous delivery of new or modified services possible Greater modularity, looser coupling. Started in the web and mobile app world, moving to Enterprise. Big in media and startups Plan for flexibility rather than reuse
  • #13: Each of the ovals represents a microservice. Each source of social media feeds has its own microservice which is specialised in interfacing with the relevant API. Each of those microservices passes messages to the ‘feed merge’ microservice which can then make them available for further microservices to work with. Communication between the microservices is over the network – they can be local to the same machine or distributed. Best practice is for each microservice to be stateless and to have its own database or schema
  • #14: Individual microservices can be updated in isolation or even removed if their role is no longer needed
  • #15: When a new role (or even a change to an existing one) appears, best practice is to implement a new microservice rather than extending an existing one.
  • #16: When a new role (or even a change to an existing one) appears, best practice is to implement a new microservice rather than extending an existing one.
  • #17: Microservices allow scale-out. Each type of microservice can be scaled independently – add extra instances just for the functions that are being overworked. Multiple instances of each service can provide High Availability
  • #18: Size. Ownership Netflix Cloud Native approach => grow org Best practice is for each microservice to be small enough that a single developer should be able to understand its entire codebase (think in hundreds rather than 10,000s of lines of code). The code for a microservice should be owned by the organization responsible for that function; for example the marketing development team should own the microservice responsible for sending nurture track emails. Netflix was one of the pioneers of Microservices with their ”Cloud Native” approach – it was really all about being able to scale their development organisation.
  • #19: 9+9
  • #20: Real world shipping containers Same container efficiently transports goods by road, rail, and sea Contents remain untouched through all those environments; no repacking needed Ubiquitous and standardized Simple to use – open, fill, close Contents of each container safe from the others Know how much space the container consumes
  • #21: Software containers Build an image containing the full application stack only once Spin up many containers from the same image in multiple environments Laptop, data center, cloud Development, QA, production, support Simple to use & efficient Contents of each container isolated from the others Storage, memory, namespace Constrain resources available to each container Storage, memory, CPU, IO
  • #25: The most popular container technology Simple to use and has a rich ecosystem 100,000+ images available from Docker Hub Including mongo hub.docker.com/_/mongo/ Syncs with GitHub projects Define new images built upon base images Define interfaces between containers LINUX, (and now) Windows, and OS X Runs on bare metal, VMs, and cloud. Cloud providers supply the Docker infrastructure (e.g. Google Container Engine)
  • #27: A single container can be interesting and useful. O2 Arena
  • #29: Microservices built by combining multiple containers Build sophisticated services from many small, focused processes (containers) Well defined APIs between components Each component can use different libraries, middleware & programming languages Modular, decoupled architecture simplifies maintenance and enables reuse Fault tolerant Scalable
  • #30: To do useful work, microservices need a way of communicating – Apache Kafka Kafka provides a flexible, scalable, and reliable method to distribute streams of event data from one or more **producers** to one or more **consumers**. Examples of **events** (or **messages**) include: A periodic sensor reading such as the current temperature A user adding an item to the shopping cart in an online store A Tweet being sent with a specific hashtag A log entry generated for each click in a web application Streams of Kafka events are organized into **topics**. A producer chooses a topic to send a given event to and consumers select which topics they pull events from. For example, a financial application could pull NYSE stock trades from one topic, and company financial announcements from another in order to look for trading opportunities. Kafka actually stores all of the messages that it passes around – this makes it ideal for production microservice deployments A microservice can be upgraded and then catch up on everything it missed Or even apply its updated business logic to the full history of events A new microservice can be added and it can be brought up to speed with everything that’s gone before If one service is generating more work than another can keep up with then Kafka operates as a buffer
  • #31: To do useful work, microservices need a way of communicating – Apache Kafka Kafka provides a flexible, scalable, and reliable method to distribute streams of event data from one or more **producers** to one or more **consumers**. Examples of **events** (or **messages**) include: A periodic sensor reading such as the current temperature A user adding an item to the shopping cart in an online store A Tweet being sent with a specific hashtag A log entry generated for each click in a web application Streams of Kafka events are organized into **topics**. A producer chooses a topic to send a given event to and consumers select which topics they pull events from. For example, a financial application could pull NYSE stock trades from one topic, and company financial announcements from another in order to look for trading opportunities. Kafka actually stores all of the messages that it passes around – this makes it ideal for production microservice deployments A microservice can be upgraded and then catch up on everything it missed Or even apply its updated business logic to the full history of events A new microservice can be added and it can be brought up to speed with everything that’s gone before If one service is generating more work than another can keep up with then Kafka operates as a buffer
  • #32: To do useful work, microservices need a way of communicating – Apache Kafka Kafka provides a flexible, scalable, and reliable method to distribute streams of event data from one or more **producers** to one or more **consumers**. Examples of **events** (or **messages**) include: A periodic sensor reading such as the current temperature A user adding an item to the shopping cart in an online store A Tweet being sent with a specific hashtag A log entry generated for each click in a web application Streams of Kafka events are organized into **topics**. A producer chooses a topic to send a given event to and consumers select which topics they pull events from. For example, a financial application could pull NYSE stock trades from one topic, and company financial announcements from another in order to look for trading opportunities. Kafka actually stores all of the messages that it passes around – this makes it ideal for production microservice deployments A microservice can be upgraded and then catch up on everything it missed Or even apply its updated business logic to the full history of events A new microservice can be added and it can be brought up to speed with everything that’s gone before If one service is generating more work than another can keep up with then Kafka operates as a buffer
  • #33: To do useful work, microservices need a way of communicating – Apache Kafka Kafka provides a flexible, scalable, and reliable method to distribute streams of event data from one or more **producers** to one or more **consumers**. Examples of **events** (or **messages**) include: A periodic sensor reading such as the current temperature A user adding an item to the shopping cart in an online store A Tweet being sent with a specific hashtag A log entry generated for each click in a web application Streams of Kafka events are organized into **topics**. A producer chooses a topic to send a given event to and consumers select which topics they pull events from. For example, a financial application could pull NYSE stock trades from one topic, and company financial announcements from another in order to look for trading opportunities. Kafka actually stores all of the messages that it passes around – this makes it ideal for production microservice deployments A microservice can be upgraded and then catch up on everything it missed Or even apply its updated business logic to the full history of events A new microservice can be added and it can be brought up to speed with everything that’s gone before If one service is generating more work than another can keep up with then Kafka operates as a buffer
  • #34: To do useful work, microservices need a way of communicating – Apache Kafka Kafka provides a flexible, scalable, and reliable method to distribute streams of event data from one or more **producers** to one or more **consumers**. Examples of **events** (or **messages**) include: A periodic sensor reading such as the current temperature A user adding an item to the shopping cart in an online store A Tweet being sent with a specific hashtag A log entry generated for each click in a web application Streams of Kafka events are organized into **topics**. A producer chooses a topic to send a given event to and consumers select which topics they pull events from. For example, a financial application could pull NYSE stock trades from one topic, and company financial announcements from another in order to look for trading opportunities. Kafka actually stores all of the messages that it passes around – this makes it ideal for production microservice deployments A microservice can be upgraded and then catch up on everything it missed Or even apply its updated business logic to the full history of events A new microservice can be added and it can be brought up to speed with everything that’s gone before If one service is generating more work than another can keep up with then Kafka operates as a buffer
  • #35: 18+5
  • #36: Automated deployment, connecting, and maintenance of multiple containers Provision hosts Instantiate containers Reschedule failed containers Link containers through defined interfaces Expose services to the outside world Scale out and back in
  • #37: Created by Google, feature-rich and widely adopted Automated container deployment and ‘replication’ On-line scale out/in Rolling upgrades HA – automatic rescheduling of failed containers Exposure of network ports to external apps Load balancing over groups of containers providing a service Provided as a service by Google Compute Engine
  • #38: Designed to scale to 10,000s of physical servers; used by Twitter, Airbnb & Apple Developer writes code to turn application into a framework to run on Mesos Less feature rich than Kubernetes; considers many functions such as load balancing, rescheduling, and scaling to be a higher level function Project exists to run Kubernetes as a Mesos framework Foundation for distributed systems Apache Aurora, Chronos, Marathon
  • #39: Don’t forget Docker Compose Factors to consider… Integration with existing DevOps frameworks? Number of hosts? Bare metal, VMs, or cloud deployment? Automated High Availability? Grouping and load balancing? Existing skills? Install your own orchestration framework or use as a service?
  • #40: 23+7
  • #47: Kubernetes not designed for stateful services 3 choices: MongoDB outside of container (Atlas?) Kubernetes manages MongoDB Kubernetes manages Ops Manager agent; Ops/Cloud Manager manage MongoDB Orchestrating MongoDB containers requires special treatment as it’s a distributed, stateful application… State should survive rescheduling; use Kubernetes’ persistent volumes abstraction Replica Set members must communicate with each other; expose external IP addresses/ports which survive rescheduling Replica Set must be initialized from exactly one member MongoDB must still be monitored and backed up – MongoDB Cloud Manager
  • #48: Kubernetes. Single Pod/comtainer/mongod in a ReplicationController. Use external IP addresses (other IP addresses & hostnames are local to Kubernetes cluster and they change) Refer to white paper for details
  • #51: 30+3
  • #52: Fast > Elegant Sagrada Familia –1882-2026 (144 years). Frequent, localised changes Localised scaling Upgrades Only if: Scaling team Designing for change Fast is more important than elegant. Change in the application’s functionality and usage is frequent. Change occurs at different rates within the application, so functional isolation and simple integration are more important than module cohesiveness. Functionality is easily separated into simple, isolatable components. When you have the developer/DevOps skillsets. Where development org boundaries match service boundaries. Don’t forget that you’re building a distributed system -> complexity but there are precedents to read up on. One argument is that you shouldn’t bother with microservices unless you need either: - Scale your team - Design for change Sagrada Familia – designed by Gaudi; construction started on March 19, 1882. Expected to be finished in 2026.
  • #53: 35+2
  • #54: Gap (flexibility): Monolith -> microservice (75 days). New types of PO took just days FuboTV (scalability). Single cluster for dev, QA + production. Cope with 100x bursts. Run MongoDB on Kubernetes Otto (arch == org). Fast, iterative delivery Backcountry (> distributed dev team): Schema changes were taking 20% of dev time. Flexible schema Compare The Market (Use Docker, Kafka, MongoDB & Ops Manager). GAP moved their purchase order system from a monolith architecture to microservices. Due to MongoDB’s flexible schema, it took just 75 days to build the new system. When requirements changed and they had to add new types of purchase orders, it took days instead of months. FuboTV is a North American soccer streaming service. Using Microservices with Kubernetes, Docker & MongoDB. Isolation means that they can use a single cluster of machines (in Google Cloud) for dev, QA & production. Very birsty application – scalability lets them handle 100x increases in traffic. Otto – the key was to have an architecture that fits with their organization. Microservices empower loosely couple development teams (business, project management, IT). This is all enabling Fast test & deployment + Iterative, Continuous Delivery Backcountry.com is an online specialty retailer that sells outdoor clothing and gear. The driver to Microservices for them was a growing, distributed development team. As more and more developers joined and made contributions to the code, the schemas became convoluted and harder to maintain; contributing to 20% of the Scrum backlog. Taking advantage of MongoDB’s flexible data model, Backcountry was able to iterate faster, reduce development time, and mitigate technical debt. Compare The Market: In the cloud, each microservice, or logical grouping of related microservices, is provisioned with its own MongoDB replica set running in Encrypted storage engine to further reduce our security-related surface area. Use Docker, Kafka & MongoDB.
  • #58: Melvin Edward Conway is a computer scientist, computer programmer, and hacker who coined what's now known as Conway's Law in 1967. If the parts of the organization do not closely reflect the essential parts of the product, or if the relationship between organizations do not reflect relationship between product parts, than the project will be in trouble -Organizations design systems which copy the organization -If the parts of the organization do not closely reflect the essential parts of the product, or if the relationship between organizations do not reflect relationship between product parts, than the project will be in trouble -Make sure the organization is compatible with the product architecture
  • #59: An alternate view is that each microservice is much larger The size will depend on your app and org. What do you need to scale? How is your org aligned? – in this case User Account, Product Catalog, Inventory & Order. The key is to do what makes sense for your enterprise: which pieces need scaling independently, which would you like to upgrade independently, how does it fit into your organisation? Functions are decoupled into four separate services (separate WAR files) and organized by business boundaries Web pages, Classes, Config files to a service are grouped together Services can evolve and iterate independently as each team can develop, test, and deploy code separately Best practice is for each microservice to have its own database.
  • #60: Normal rules still apply Containers provide opportunities to improve security Containers provide isolation; resources can only be accessed from outside through explicitly provided APIs Resources can be rationed A container’s role can be very narrow – remove anything not required Images and containers should be kept current; rolling upgrades with Kubernetes or Aurora Typically log into container as root so restrict access