SlideShare a Scribd company logo
Quick poll…
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/cloud-anti-patterns
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Presented at QCon London
www.qconlondon.com
Welcome to sunny London!
Tammer Saleh
Geek: Unix, Ruby, Golang, etc
Cloud Foundry @ Pivotal
http://tammersaleh.com | tsaleh@pivotal.io
Microservice
Anti-patterns
How not to go down in flames.
Why microservices?
What is a microservice, and why do I care?
Monolithic
Entire application in a single codebase,
deployed and scaled as a single unit.
Monolithic
Hard to scale the application.
Impossible to scale the team.
It’s not about code… It’s about teams.
But it can go wrong.
Here are the most common problems we
see in the wild, and how to fix them.
Overzealous Services
The most common
mistake is to
start with
microservices
Boring is Beautiful™
Solution: Start monolithic and extract
Microservices are complex and add a constant tax to development.
Build a boring application and extract services as needed.
Twitter
/tweet
/dashboard
/…
/…
Heavy and Expensive
/tweet
Twitter
/dashboard
/…
/…
Lite and Cheap
Congratulations
You’re now a microservice architect.
Schemas everywhere
/dashboard
/…
/…
/tweet v1
v1
V1 Schema
Deploy v2
Schemas everywhere
/dashboard
/…
/…
/tweet v1
v2
V1 Schema
Deploy v2
Migrate v2
/dashboard
/…
/…
/tweet v1
v2
V2 Schema
Deploy v2
Schemas everywhere
Migrate v2
/dashboard
/…
/…
/tweet v2
v2
V2 Schema
Schemas everywhere
Solution: Gatekeeper
/dashboard
/…
/…
/tweet v1
v2
Tweets
/bulk_add
Tweet Service
GET /tweets
GET /tweets/ID
Owns database and migrations
Lock-step deployment
Service B
Service A
Service C — v1
v1
v1
Lock-step deployment
Service B
Service A
Service C — v2
v1
v1
Deploy v2
Lock-step deployment
Service B
Service A
Service C — v2
v1
v1
Deploy v2
Lock-step deployment
Service B
Service A
Service C — v2
v2
v2
Deploy v2
Solution: Semantic Versioning
Service B
Service A
Service C — v1
v1
v1
vMajor.Minor.Patch
MYBAD.SHINY.OOPS
Solution: Semantic Versioning
Service B
Service A
Service C — v1.2
v1
v1
Deploy v1.2
(extra stuff)
:)
:)
Solution: Semantic Versioning
Service B
Service A
Service C — v1.2
v1.2
v1.2
Deploy v1.2
Solution: Semantic Versioning
Service B
Service A
Service C — v1.2
v1.2
v1.2
Deploy v2
(breaking change)
Service C — v2
Solution: Semantic Versioning
Service B
Service A
Service C — v1.2
v1.2
v2
Service C — v2
Deploy v2
Solution: Semantic Versioning
Service B
Service A
Service C — v1.2
v2
v2
Service C — v2
Deploy v2
OMG ALL THE STEPS!!!
See Rule #1
Spiky load between services
Must maintain enough servers to handle peak load.
/tweet
/dashboard
/…
/…
Spiky load between services
/tweet
/dashboard
/…
/…
Spiky load between services
Queues in between services provide buffers that smooth traffic.
Solution: Amortize via queues
Peak load is now much lower.
/tweet
/dashboard
/…
/…
Solution: Amortize via queues
Solution: Amortize via queues
/tweet
/dashboard
/…
/…
Worker
Complexity: Now clients must deal with asynchronous responses.
Hardcoded IPs and Ports
Simple to get started, but immediately leads to deployment issues.
Solution 1: Discovery Service
etcdconsul
Solution 1: Discovery Service
Service A
Service B
(192.168.0.2:1234)
Where is B?
192.168.0.2:1234
Solution 1: Discovery Service
Service A
Service B
(192.168.0.2:1234)
Hey there!
Solution 1: Discovery Service
Complexity: Your code must understand the service lookup system.
Solution 2: Centralised router
Service AService B
Router
Service B Service A Service AService B
A A BB A A BBA A BB
Solution 2: Centralised router
Simplicity: “It’s just DNS.”
Router vs Discovery Service
Both require service registration.
Discovery Service is simpler to build
and scale, since it doesn’t need to
route all data.
Discovery service does fewer
network hops.
Router is transparent.
Router can be exposed externally.
Router can cache transparently.
Router can round-robin.
Both require HA and scalability.
Dogpiles
Service BService A
You there?
No.
How about now?
I’m busy.
But I wanna chat!
Go away
Whachya doin?
Please leave me alone.
Wanna be friends?
I hate you.
Dogpiles
Service B
Service A Service A
Service A Service A
x 100
Solution: Circuit Breaker
Service B
Service A Service A
Where’s B?
B’s sick. Wait 10 min.
Hello!
Go to Hell!
Hey, B’s sick :(
Debugging hell
Turns out, distributed systems are hard.
Debugging Hell
Service 3
Service 1 Service 2
time:1428374783 source:service3 msg:”Error with payment!”
Where?? Why?? Who??
Solution: Correlation IDs
Service
Service Service
CID: 1234 CID: 1234
CID:1234
time:1427127483 source:service1 id:1234 msg:”Received request…”
time:1427348748 source:service2 id:1234 msg:”Processing payment"
time:1428374783 source:service3 id:1234 msg:”Error with payment!”
Solution: Correlation IDs
1. Tag all incoming requests with
unique ID
2. Service saves ID for all incoming
requests
3. Include that ID in all log lines,
etc.
4. Tag new requests with that ID
ServiceLogs
ID
ID
ID
ID
Complexity: Must be done manually.
Missing Mock Servers
Each consuming team has to create
their own mocks and stubs.
Missing Mock Servers
Service A
Team A
Missing Mock Servers
Service A Service B
HTTP
Team A Team B
Product Surface Area
Missing Mock Servers
Service A Service B
HTTP
Mock of Service A
HTTP
Team A Team B
For each service…
For each team…
Service A Service B
HTTP
Mock of Service A
HTTP
Team A Team B
Better…Solution: Service Team Provides the Mock
Team B still needs to know
how to run Mock Service A
Solution: Service Team Owns the Client
Service A Service B
HTTP
H
TTP
Team A Team B
Client A
MOCK=“true”
Best…
Mock of Service A
Product Surface Area
Both modes are tested in CI
Team A can change
the protocol as they see fit
Flying Blind
Solution: Graphs, alerts, pages.
Solution: Graphs, alerts, pages.
Alerting Rules EnginePlatform Events
OMGWAT???AppsAppsAppsAppsAppsAppsAppsAppsAppsAppsApps
Snowflakes
Snowflakes
Ruby XSS exploit!
BASH remote exploit!
Snowflakes
Containers
Virtual Machines
Solution: Golden Image
Solution: Golden Image
Golden OS Image
Common Runtimes
and Frameworks
+
Base Platform
=
Doomsday Deployments
Solution: Predictable Pipelines
Solution: Predictable Pipelines
http://concourse.ci
Solution: Predictable Pipelines
Need to trust your tests, your
platform, and your automation.
Operational Explosion!
Operational Explosion!
Operations block Development
Solution: AUTOMATE ALL THE THINGS!!!!!
Form a team to build tools that enable developers to
manage the system in an entirely automated way.
OMG ALLTHETHINGS????
App deployment, infrastructure provisioning, OS installation,
configuration management, database provisioning, disaster
recovery, application monitoring, HA, blue-green deployments,
self-healing, scaling, runtime installation, log rotation, backups, security
updates, database upgrades, application logs, system logs, database
logs, continuous integration, continuous deployment, service discovery,
monitor queue usage, security monitoring, hotspot detection, error monitoring,
issue notification and escalation, virtual machine migration, shard rebalancing,
circuit breaker monitoring, resiliency testing, database snapshots, flux capacitors,
ion overdrive maintenance, change the oil, dog feeding, cat shooting, pig eating…
Time and Money
Solution: AUTOMATE ALL THE THINGS!!!!!
Microservices Antipatterns
In summary…
Start boring and extract to services.
Understand the hidden schemas.
Amortize traffic with queues.
Decouple through discovery tools.
Contain failures with circuit breakers.
Enable other teams through mockable
clients.
Kill your snowflakes.
Automate your deployments.
Build in operations tools from the beginning.
Make use of a platform like Cloud Foundry.
Watch the video with slide synchronization on
InfoQ.com!
http://www.infoq.com/presentations/cloud-
anti-patterns

More Related Content

ODP
Microservices Patterns and Anti-Patterns
PDF
How Netflix does Microservices
PDF
Orchestration Patterns for Microservices with Messaging by RabbitMQ
PDF
Day in the life event-driven workshop
PDF
KrakenD API Gateway
PDF
Asynchronous Microservices in nodejs
PPTX
From Monolithic to Microservices in 45 Minutes
PDF
NATS: Control Flow for Distributed Systems
Microservices Patterns and Anti-Patterns
How Netflix does Microservices
Orchestration Patterns for Microservices with Messaging by RabbitMQ
Day in the life event-driven workshop
KrakenD API Gateway
Asynchronous Microservices in nodejs
From Monolithic to Microservices in 45 Minutes
NATS: Control Flow for Distributed Systems

What's hot (20)

PDF
How to Migrate to Cloud with Complete Confidence and Trust
PDF
NATS Connector Framework - Boulder Meetup
PDF
Distributed Enterprise Monitoring and Management of Apache Kafka (William McL...
PPTX
Microservices continuous delivery with mantl & shipped
PDF
Kafka Connect & Kafka Streams/KSQL - powerful ecosystem around Kafka core
PDF
Agile integration cloud native developement
PDF
Internet of Things (IoT) - in the cloud or rather on-premises?
PDF
Microservices Architecture
PDF
Microservice no fluff, the REAL stuff
PDF
Don't Cross the Streams! (or do, we got you)
PDF
What is Reactive programming?
PDF
NATS: A Central Nervous System for IoT Messaging - Larry McQueary
PPTX
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud - An...
PDF
Spring Into the Cloud
PPTX
Modeling microservices using DDD
PPTX
How Narvar Uses Pulsar to Power the Post-Purchase Experience - Pulsar Summit ...
PDF
Apache Kafka Scalable Message Processing and more!
PPTX
Microservices with Spring
PPTX
Debugging Microservices - key challenges and techniques - Microservices Odesa...
PDF
Intro - Cloud Native
How to Migrate to Cloud with Complete Confidence and Trust
NATS Connector Framework - Boulder Meetup
Distributed Enterprise Monitoring and Management of Apache Kafka (William McL...
Microservices continuous delivery with mantl & shipped
Kafka Connect & Kafka Streams/KSQL - powerful ecosystem around Kafka core
Agile integration cloud native developement
Internet of Things (IoT) - in the cloud or rather on-premises?
Microservices Architecture
Microservice no fluff, the REAL stuff
Don't Cross the Streams! (or do, we got you)
What is Reactive programming?
NATS: A Central Nervous System for IoT Messaging - Larry McQueary
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud - An...
Spring Into the Cloud
Modeling microservices using DDD
How Narvar Uses Pulsar to Power the Post-Purchase Experience - Pulsar Summit ...
Apache Kafka Scalable Message Processing and more!
Microservices with Spring
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Intro - Cloud Native
Ad

Similar to Microservices Antipatterns (20)

PDF
Microservices: State of the Union
PDF
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PDF
Consul: Service-oriented at Scale
PDF
Microservices - Hitchhiker's guide to cloud native applications
PDF
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
PDF
John adams talk cloudy
PPTX
Microservices: next-steps
PDF
Cloud Architecture Tutorial - Running in the Cloud (3of3)
PDF
Scalable Microservices at Netflix. Challenges and Tools of the Trade
PPTX
Tef con2016 (1)
PDF
Jeff Lindsay: Building Public Infrastructure with Autosustainable Services
PPTX
Microservices pros and cons
PDF
Building Microservices Software practics
PDF
What's Missing? Microservices Meetup at Cisco
PPTX
Cloud 2.0: Containers, Microservices and Cloud Hybridization
PPTX
Microservices pros and cons dark
PDF
Chirp 2010: Scaling Twitter
PDF
Microservice architecture
PDF
Experiences with Microservices at Tuenti
PDF
Service Mesh Talk for CTO Forum
Microservices: State of the Union
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
Consul: Service-oriented at Scale
Microservices - Hitchhiker's guide to cloud native applications
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
John adams talk cloudy
Microservices: next-steps
Cloud Architecture Tutorial - Running in the Cloud (3of3)
Scalable Microservices at Netflix. Challenges and Tools of the Trade
Tef con2016 (1)
Jeff Lindsay: Building Public Infrastructure with Autosustainable Services
Microservices pros and cons
Building Microservices Software practics
What's Missing? Microservices Meetup at Cisco
Cloud 2.0: Containers, Microservices and Cloud Hybridization
Microservices pros and cons dark
Chirp 2010: Scaling Twitter
Microservice architecture
Experiences with Microservices at Tuenti
Service Mesh Talk for CTO Forum
Ad

More from C4Media (20)

PDF
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
PDF
Next Generation Client APIs in Envoy Mobile
PDF
Software Teams and Teamwork Trends Report Q1 2020
PDF
Understand the Trade-offs Using Compilers for Java Applications
PDF
Kafka Needs No Keeper
PDF
High Performing Teams Act Like Owners
PDF
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
PDF
Service Meshes- The Ultimate Guide
PDF
Shifting Left with Cloud Native CI/CD
PDF
CI/CD for Machine Learning
PDF
Fault Tolerance at Speed
PDF
Architectures That Scale Deep - Regaining Control in Deep Systems
PDF
ML in the Browser: Interactive Experiences with Tensorflow.js
PDF
Build Your Own WebAssembly Compiler
PDF
User & Device Identity for Microservices @ Netflix Scale
PDF
Scaling Patterns for Netflix's Edge
PDF
Make Your Electron App Feel at Home Everywhere
PDF
The Talk You've Been Await-ing For
PDF
Future of Data Engineering
PDF
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Next Generation Client APIs in Envoy Mobile
Software Teams and Teamwork Trends Report Q1 2020
Understand the Trade-offs Using Compilers for Java Applications
Kafka Needs No Keeper
High Performing Teams Act Like Owners
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Service Meshes- The Ultimate Guide
Shifting Left with Cloud Native CI/CD
CI/CD for Machine Learning
Fault Tolerance at Speed
Architectures That Scale Deep - Regaining Control in Deep Systems
ML in the Browser: Interactive Experiences with Tensorflow.js
Build Your Own WebAssembly Compiler
User & Device Identity for Microservices @ Netflix Scale
Scaling Patterns for Netflix's Edge
Make Your Electron App Feel at Home Everywhere
The Talk You've Been Await-ing For
Future of Data Engineering
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More

Recently uploaded (20)

PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
KodekX | Application Modernization Development
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Per capita expenditure prediction using model stacking based on satellite ima...
KodekX | Application Modernization Development
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectral efficient network and resource selection model in 5G networks
Mobile App Security Testing_ A Comprehensive Guide.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Dropbox Q2 2025 Financial Results & Investor Presentation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Advanced methodologies resolving dimensionality complications for autism neur...
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
Advanced Soft Computing BINUS July 2025.pdf
GamePlan Trading System Review: Professional Trader's Honest Take
MYSQL Presentation for SQL database connectivity
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The AUB Centre for AI in Media Proposal.docx
NewMind AI Weekly Chronicles - August'25 Week I

Microservices Antipatterns