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

PDF
Dell Technologies Dell EMC ISG Storage, CI, HCI and Data Protection Portfolio...
PPT
Зовнішня політика Гітлера 2. ppt
PDF
Genesys PureCloud By IST Egypt
PPT
Operation Overlord
 
PDF
DLJCJUG 2015: The Seven Deadly Sins of Microservices
PDF
ビズリーチではDBFluteハンズオンやってます(DBFluteフェス2014)
PDF
Emacs上のターミナルを最強に
PDF
WTF is a Microservice - Rafael Schloming, Datawire
Dell Technologies Dell EMC ISG Storage, CI, HCI and Data Protection Portfolio...
Зовнішня політика Гітлера 2. ppt
Genesys PureCloud By IST Egypt
Operation Overlord
 
DLJCJUG 2015: The Seven Deadly Sins of Microservices
ビズリーチではDBFluteハンズオンやってます(DBFluteフェス2014)
Emacs上のターミナルを最強に
WTF is a Microservice - Rafael Schloming, Datawire

Viewers also liked (7)

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
ゼロからはじめるプロダクトマネージャー生活
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
Yotpo microservices
PDF
Steve Vinoski Rest And Reuse And Serendipity
PDF
Rest Reuse And Serendipity
PDF
Growing an ecosystem on the JVM
PPTX
Cross-platform interaction
PDF
#JaxLondon keynote: Developing applications with a microservice architecture
PDF
Developing Applications with a Micro Service Architecture - Chris Richardson
PDF
Cloud Native API Design and Management
PDF
Microservices and the Art of Taming the Dependency Hell Monster
PPT
Building scalable and language independent java services using apache thrift
PPTX
Lecture 04 - Loose Coupling
PDF
Developing applications with a microservice architecture (SVforum, microservi...
PDF
L11 Service Design and REST
PPT
Building scalable and language-independent Java services using Apache Thrift ...
PDF
Developing applications with a microservice architecture (svcc)
PDF
Zero to scaleable in ten minutes
PDF
Business-friendly library for inter-service communication
KEY
CommonJS via PINF JavaScript Loader - Introduction
PDF
A sane approach to microservices
PPTX
Tef con2016 (1)
Yotpo microservices
Steve Vinoski Rest And Reuse And Serendipity
Rest Reuse And Serendipity
Growing an ecosystem on the JVM
Cross-platform interaction
#JaxLondon keynote: Developing applications with a microservice architecture
Developing Applications with a Micro Service Architecture - Chris Richardson
Cloud Native API Design and Management
Microservices and the Art of Taming the Dependency Hell Monster
Building scalable and language independent java services using apache thrift
Lecture 04 - Loose Coupling
Developing applications with a microservice architecture (SVforum, microservi...
L11 Service Design and REST
Building scalable and language-independent Java services using Apache Thrift ...
Developing applications with a microservice architecture (svcc)
Zero to scaleable in ten minutes
Business-friendly library for inter-service communication
CommonJS via PINF JavaScript Loader - Introduction
A sane approach to microservices
Tef con2016 (1)
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)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
cuic standard and advanced reporting.pdf
PPTX
Cloud computing and distributed systems.
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
NewMind AI Monthly Chronicles - July 2025
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
20250228 LYD VKU AI Blended-Learning.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
cuic standard and advanced reporting.pdf
Cloud computing and distributed systems.
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Encapsulation_ Review paper, used for researhc scholars
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...

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