SlideShare a Scribd company logo
Ben Christensen
@benjchristensen
Microservices Summit – Jan 2016
AvoidDistributedMonoliths
Don't Couple Systems
With Binary Dependencies
Shared Libraries
&
Network Clients
Shared Libraries
that are required
Shared Libraries
often called "the platform"
Shared Libraries
(and the transitive variety)
Network Clients
of the "official" variety
What does binary coupling look like?
Common Examples ...
Routing
Discovery
Logging
Tracing
Fault Injection
Guava
RxJava
Log4j
Apache Commons
Spring
etc ...
Spring
Struts
Netty
Tomcat
Apache HttpClient
Not long until
100s of libraries
are required to exist
in a given system
Not long until
100s of libraries
are required to exist
in a given system
This is a "distributed monolith"
Have you ever seen it
take
months to upgrade a
library across your
company?
Have you ever seen it
take
months to upgrade a
library across your
company?
This is a "distributed monolith"
Will it take a ~year to
use a new language for
a new service?
Will it take a ~year to
use a new language for
a new service?
This is a "distributed monolith"
These Symptoms == Lost BenefitsLost Benefits
Lost Benefits
Polyglot
Lost Benefits
Polyglot
Can Java, .Net, Node.js, Go, Rust, C++, etc
co-exist in your system? idiomatically?
Lost Benefits
Organizational and Technical Decoupling
Lost Benefits
Organizational and Technical Decoupling
Can an individual team adopt a new language or
platform without convincing a central authority?
Lost Benefits
Organizational and Technical Decoupling
Can individual teams choose a different
concurrency model than the "core platform"?
Lost Benefits
Temporal Decoupling
Lost Benefits
Temporal Decoupling
Can an individual team upgrade their networking
stack?
Lost Benefits
Temporal Decoupling
Can they upgrade to the newest version of Guava?
But isn't shared code good?
But isn't shared code good?
Not Always
Not necessarily the right principle
to prioritize across system boundaries.
But isn't shared code good?
"First, you lose true technology
heterogeneity. The library typically has to
be in the same language, or at the very
least run on the same platform."
"Building Microservices" – Sam Newman
"Second, the ease with which you can
scale parts of your system independently
from each other is curtailed."
"Building Microservices" – Sam Newman
"...you cannot deploy a new library
without redeploying the entire process, so
your ability to deploy changes in isolation
is reduced."
"Building Microservices" – Sam Newman
"And perhaps the kicker is that you lack
the obvious seams around which to erect
architectural safety measures to ensure
system resiliency."
"Building Microservices" – Sam Newman
But DRY!?!?
"Building Microservices" – Sam Newman
Page 59, "DRY and the Perils of Code Reuse in a Microservice World"
"This approach, however, can be
deceptively dangerous in a microservice
architecture."
"Building Microservices" – Sam Newman
Page 59, "DRY and the Perils of Code Reuse in a Microservice World"
"One of the things we want to avoid at all
costs is overly coupling a microservice and
consumers such that any small change to
the microservice itself can cause
unnecessary changes to the consumer."
"Building Microservices" – Sam Newman
Page 59, "DRY and the Perils of Code Reuse in a Microservice World"
"If your use of shared code ever leaks
outside your service boundary, you have
introduced a potential form of coupling."
"Building Microservices" – Sam Newman
Page 59, "DRY and the Perils of Code Reuse in a Microservice World"
"The evils of too much coupling between
services are far worse than the problems
caused by code duplication."
Page 59
"DRY and the Perils of Code Reuse
in a Microservice World"
Just go read it ...
Observed Outcomes
Client library becomes ONLY official
way to access the service.
Service logic drifts into the client.
Nearly impossible to adopt
new architectures, languages, etc.
Far Reaching Effects
Consuming team is at the
mercy of the service-owner.
Brittle "Black Market" Clients
Projection of technical decisions,
architecture, and resource utilization
on all service consumers.
Operational complexity is
spread to all consumers.
Team consuming 10 services now
potentially has arbitrary code from 10
teams to operate and debug.
So what is the alternative?
Contracts & Protocols!
Like programming languages
use interfaces and APIs.
Services should hide
all implementation details.
Network Protocol & Data Contract
Consume with any language and any technology!
Iterate and change over time!
No dependency on service implementation!
Just like the Internet!
But, but, but!!!
What about ... ?
What about ... ?
standardized logging, fault injection,
distributed tracing, discovery, routing,
bulkheading, etc, etc, etc
Legitimate Needs for Standardization
Standardization Does Not Need Binary Coupling
Standardization via Protocols & Contracts
Enabled via independent common libraries
that consumers can choose to use
... or reimplement to suit their needs.
Standardization via Protocols & Contracts
Standardization via Protocols & Contracts
Example
Public AWS APIs
with
various available clients
Standardization via Auditing
Standardization via Auditing
An "integration test" for new services.
Tracing? Logging? Fault injection? Routing?
Doesn't this make it harder to
start a new service?
It could. But it doesn't need to.
Common "Tech Stacks"
do not break this pursuit of decoupling
Key is that existence of
protocols and contracts
allow new stacks to be built.
Anything achieved by any library
should be replaceable by coding against
protocols and contracts.
Litmus test ...
Can a group of engineers wanting to
use the new hotness
build a new stack
without convincing the rest of the company?
and without resorting to
sidecars and proxies?
What might this look like?
Shared Libraries
&
Network Clients
Transitive Dependencies
Shade Internal Dependencies
Transitive Dependencies
or copy/paste the needed method!
Transitive Dependencies
If part of public API ...
Transitive Dependencies
If part of public API ...
it can't ever have a breaking change.
Transitive Dependencies
(so no libraries that bump their
major version every 6-12 months)
Transitive Dependencies
If part of public API ...
it can't ever have a breaking change.
OkHttp & RxJava as examples
http://jakewharton.com/java-interoperability-policy-for-major-version-updates/
https://publicobject.com/2015/12/12/com-squareup-okhttp3/
https://github.com/ReactiveX/RxJava/issues/3170
https://github.com/ReactiveX/RxJava/issues/3173
Transitive Dependencies
Shared Libraries
&
Network Clients
/pets:
get:
description: Returns all pets from the system that the user has access to
produces:
- application/json
responses:
'200':
description: A list of pets.
schema:
type: array
items:
$ref: '#/definitions/pet'
Swagger / OpenAPI
Swagger / OpenAPI
5: optional TweetType tweetType = TweetType.TWEET;
16: optional string language = "english";
}
typedef list<Tweet> TweetList
struct TweetSearchResult {
1: TweetList tweets;
}
exception TwitterUnavailable {
1: string message;
}
const i32 MAX_RESULTS = 100;
service Twitter {
void ping(),
bool postTweet(1:Tweet tweet) throws (1:TwitterUnavailable unavailable),
TweetSearchResult searchTweets(1:string query);
oneway void zip()
}
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
enum PhoneType {
MOBILE = 0;
HOME = 1;
WORK = 2;
}
message PhoneNumber {
required string number = 1;
optional PhoneType type = 2 [default = HOME];
}
repeated PhoneNumber phone = 4;
}
message AddressBook {
repeated Person person = 1;
}
@version("0.1.0")
package hello {
@doc("A value class for Request data for the hello service.")
class Request {
String text;
}
@doc("A value class for Response data from the hello service.")
class Response {
@doc("A greeting from the hello service.")
String result;
}
@doc("The hello service.")
interface Hello extends Service {
@doc("Respond to a hello request.")
@delegate(self.rpc, {"timeout": 3000})
Response hello(Request request);
}
@doc("A client adapter for the hello service.")
class HelloClient extends Client, Hello {}
@doc("A server adapter for the hello service.")
class HelloServer extends Server<Hello> {}
}
Quark by DataWire
/pets:
get:
description: Returns all pets from the system that the user has access to
produces:
- application/json
responses:
'200':
description: A list of pets.
schema:
type: array
items:
$ref: '#/definitions/pet'
Single | Multi | N | Infinite
Beyond Request/Response
Caching Tiers
Default Fallback Values
Flow Control & Health
So why do we fail at this so often?
Ease.
Short-term feels more productive.
Service-owners have "first-mover" advantage.
Delayed cost of decoupling is high.
And it's very hard.
The solutions have limited tax on the short-term.
So let's look beyond the short-term ease.
Avoid Binary Coupling
by using
Contracts, Protocols
& Automated Tooling

More Related Content

PPTX
Hybrid renewable energy systems
PDF
Power plant engineering
PDF
Com u2 2g_sesion12
DOC
SESIÓN - ENCUENTRO FAMILIAR DE APRENDIZAJE - PRIMARIA
PPT
Biomass Gasification
PPTX
BIOMASS FUELED POWER PLANT
PPTX
Improved cook stove - Prof. K.R.Shrestha
PPTX
Residential Solar Presentation
Hybrid renewable energy systems
Power plant engineering
Com u2 2g_sesion12
SESIÓN - ENCUENTRO FAMILIAR DE APRENDIZAJE - PRIMARIA
Biomass Gasification
BIOMASS FUELED POWER PLANT
Improved cook stove - Prof. K.R.Shrestha
Residential Solar Presentation

Viewers also liked (11)

PDF
DLJCJUG 2015: The Seven Deadly Sins of Microservices
PDF
ビズリーチではDBFluteハンズオンやってます(DBFluteフェス2014)
PDF
Emacs上のターミナルを最強に
PDF
WTF is a Microservice - Rafael Schloming, Datawire
KEY
Schema Design for Riak
PDF
Microservices Standardization - Susan Fowler, Stripe
PPTX
Microservices are the Future! (...and always will be) - Josh Holtzman, PayPal...
PDF
The 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
PDF
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
PDF
Steamで同人ゲームをリリースする ~パブリッシャーになって検証してみた~
PDF
ゼロからはじめるプロダクトマネージャー生活
DLJCJUG 2015: The Seven Deadly Sins of Microservices
ビズリーチではDBFluteハンズオンやってます(DBFluteフェス2014)
Emacs上のターミナルを最強に
WTF is a Microservice - Rafael Schloming, Datawire
Schema Design for Riak
Microservices Standardization - Susan Fowler, Stripe
Microservices are the Future! (...and always will be) - Josh Holtzman, PayPal...
The 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Steamで同人ゲームをリリースする ~パブリッシャーになって検証してみた~
ゼロからはじめるプロダクトマネージャー生活
Ad

Similar to Microservices Practitioner Summit Jan '15 - Don't Build a Distributed Monolith - Ben Christensen, Facebook (20)

PPTX
Microservices for performance - GOTO Chicago 2016
PPTX
Splunk Conf 2014 - Getting the message
PPT
Azure + WP7 - CodePaLOUsa
PDF
Stateful mock servers to the rescue on REST ecosystems
PDF
An Introduction to Microservices
PPTX
Being HAPI! Reverse Proxying on Purpose
PPTX
Microservice Pattern Launguage
PPTX
Microservices architecture
PPTX
Building a new ecosystem for interoperable communications
PDF
The Case Against Microservices
ODP
The Art of Message Queues - TEKX
DOCX
1 SDEV 460 – Homework 4 Input Validation and Busine
PPTX
The Veil-Framework
PPT
Azure & WP7 at GRDevDay
PPTX
.NET Fest 2019. Irina Scurtu. Forget about HTTP
PPTX
Signal R 2015
PDF
Microservices architecture with Python_ Building scalable and maintainable sy...
PPTX
Session
PPTX
SignalR + Mobile Possibilities
Microservices for performance - GOTO Chicago 2016
Splunk Conf 2014 - Getting the message
Azure + WP7 - CodePaLOUsa
Stateful mock servers to the rescue on REST ecosystems
An Introduction to Microservices
Being HAPI! Reverse Proxying on Purpose
Microservice Pattern Launguage
Microservices architecture
Building a new ecosystem for interoperable communications
The Case Against Microservices
The Art of Message Queues - TEKX
1 SDEV 460 – Homework 4 Input Validation and Busine
The Veil-Framework
Azure & WP7 at GRDevDay
.NET Fest 2019. Irina Scurtu. Forget about HTTP
Signal R 2015
Microservices architecture with Python_ Building scalable and maintainable sy...
Session
SignalR + Mobile Possibilities
Ad

More from Ambassador Labs (20)

PDF
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
PDF
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
PDF
Cloud native development without the toil
PPTX
Webinar: Accelerate Your Inner Dev Loop for Kubernetes Services
PDF
[Confoo Montreal 2020] From Grief to Growth: The 7 Stages of Observability - ...
PDF
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
PDF
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
PDF
What's New in the Ambassador Edge Stack 1.0?
PDF
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes
PDF
Ambassador: Building a Control Plane for Envoy
PDF
Telepresence - Fast Development Workflows for Kubernetes
PDF
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
PDF
[KubeCon NA 2018] Effective Kubernetes Develop: Turbocharge Your Dev Loop - P...
PDF
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...
PDF
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
PDF
Ambassador Kubernetes-Native API Gateway
PPTX
Micro xchg 2018 - What is a Service Mesh?
PDF
KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)
PDF
Webinar: Code Faster on Kubernetes
PDF
QCon SF 2017 - Microservices: Service-Oriented Development
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
Cloud native development without the toil
Webinar: Accelerate Your Inner Dev Loop for Kubernetes Services
[Confoo Montreal 2020] From Grief to Growth: The 7 Stages of Observability - ...
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
What's New in the Ambassador Edge Stack 1.0?
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes
Ambassador: Building a Control Plane for Envoy
Telepresence - Fast Development Workflows for Kubernetes
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Effective Kubernetes Develop: Turbocharge Your Dev Loop - P...
The rise of Layer 7, microservices, and the proxy war with Envoy, NGINX, and ...
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
Ambassador Kubernetes-Native API Gateway
Micro xchg 2018 - What is a Service Mesh?
KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)
Webinar: Code Faster on Kubernetes
QCon SF 2017 - Microservices: Service-Oriented Development

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Machine Learning_overview_presentation.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Cloud computing and distributed systems.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Electronic commerce courselecture one. Pdf
PDF
Machine learning based COVID-19 study performance prediction
Digital-Transformation-Roadmap-for-Companies.pptx
Assigned Numbers - 2025 - Bluetooth® Document
20250228 LYD VKU AI Blended-Learning.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Machine Learning_overview_presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Dropbox Q2 2025 Financial Results & Investor Presentation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Diabetes mellitus diagnosis method based random forest with bat algorithm
Cloud computing and distributed systems.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
MYSQL Presentation for SQL database connectivity
Unlocking AI with Model Context Protocol (MCP)
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Empathic Computing: Creating Shared Understanding
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Electronic commerce courselecture one. Pdf
Machine learning based COVID-19 study performance prediction

Microservices Practitioner Summit Jan '15 - Don't Build a Distributed Monolith - Ben Christensen, Facebook