Introduction To Microservices: Architecture Principles, How To, Patterns, Examples
Introduction To Microservices: Architecture Principles, How To, Patterns, Examples
Introduction To Microservices: Architecture Principles, How To, Patterns, Examples
INTRODUCTION TO MICROSERVICES
MICROSERVICES ARCHITECTURE
Microservices (2014)
Client
Client Load Balancer
Client Monolith
lack of modularity
MAKING THE MONOLITH MORE MODULAR
• Specialized instances of a single codebase
– Modular invocation
Load Balancer Real time
business logic
Client
Client
Client
http://martinfowler.com/articles/microservices.html
GILT TESTIMONIAL
http://www.infoq.com/news/2015/04/scaling-microservices-gilt
GILT TESTIMONIAL
http://www.infoq.com/news/2015/04/scaling-microservices-gilt
Common Characteristics
• Designer,
product
manager, and
front-end
developer
working close to
each other
SOUNDCLOUD TESTIMONIAL
• The irreducible complexity of the monolith
– Why do we need Pull Requests?
– Why do people make mistakes so often?
– Why is the code base so complex?
– Why do we need a single code base to implement
the many components?
– Why can’t we have economies of scale for
multiple, smaller, systems?
SOUNDCLOUD TESTIMONIAL
• Isolated new features in
dedicated microservices,
isolated from the monolith
• New organization with team
of 3 to 4 people
• Each team is responsible for
decided whether parts of
the Monolith are extracted
and rewritten , or kept
COMMITTED TEAMS
• Ownership core to team organization
– built into the management of the organization
– make sure that teams have sufficient time to truly
own the applications that they are in charge
• “Products versus Projects” principle
• “Functional versus Divisional” organizations
– And give them 360 view on operations
THE NETFLIX MICROSERVICES JOURNEY
• Migration to AWS
http://netflix.github.io/falcor/starter/what-is-falcor.html
SPINNAKER - MICROSERVICES CONSOLE
SPINNAKER - MICROSERVICES CONSOLE
DEPENDENCY GRAPH BASED
ON REAL TRAFFIC
VECTOR
How big should be my microservices ?
RESTish microservices ?
Isn’t it SOA ?
The end of the monoliths ?
FAQ
HOW BIG ?
• Microservices ownership implies that each team is
responsible for the entire lifecycle
– functional vs divisional organizations
– product management, development, QA, documentation,
support
• Sizing depends on the system you’re building
– Amazon 2PT principle - Two Pizza Teams
– 6 to 10 people to build/deploy/maintain a microservice
– an average microservice at Gilt consists of 2000 lines of
code, 5 source files, and is run on 3 instances in production
RESTISH MICROSERVICES ?
• REST
– Web lingua franca, 100% interoperable
– development cost is generally higher
– best practices : provide client sdks, (ex : generated from
Swagger/RAML or other API description languages)
– performance issues if not well-designed (chattiness)
– best practices : experience based and coarser grained APIs
• RPC
– optimized communication via binary formats
– automated generation from IDL, polyglot by default
– integrated support multiples scenarios : request/response,
streaming, bi-directional streaming
HOW RESTISH MICROSERVICES ?
• RPC vs REST style depends on the system you’re
building and teams existing skills set
• Whatever the style, your microservices architecture
MUST provide
– Services Discovery,
– Reliable Communications,
– Operational insights (logs, monitoring, alerts, real time
analysis)
GOT IT, BUT ISN’T IT SOA ?
• SOA so what ?
– Enterprise SOA
– Event-driven architecture (Pub/Sub)
– Streaming Services (real-time time series,
bidirectional)
– Container-Services (ala Docker)
– Nanoservices (ala AWS Lambda)
analysis of a
mobile app
usage
VS CONTAINER SERVICES
http://www.stavros.io/posts/microservices-cargo-cult/
FROM MONOLITHS TO MICROSERVICES
• Velocity of innovation for complex systems
– Keep your monolith as is if you don’t need to
speed up features delivery
• To prepare for the journey
• switch from layered architecture to internal APIs,
• automate integration and deployment,
• reorganize from divisional to functional teams
committed to business and owning their code
REFERENCES
Microservices, Martin Fowler, James Lewis
– http://martinfowler.com/articles/microservices.html
A day in the life of a Netflix Engineer using 37% of the internet
– http://fr.slideshare.net/AmazonWebServices/dvo203-the-life-of-a-
netflix-engineer-using-37-of-the-internet
Dzone – Geting started with Microservices
– https://dzone.com/refcardz/getting-started-with-microservices
SoundCloud – How we ended up with microservices
– http://philcalcado.com/2015/09/08/how_we_ended_up_with_micros
ervices.html
gRPC - boilerplate to high-performance scalable APIs
– http://fr.slideshare.net/AboutYouGmbH/robert-kubis-grpc-boilerplate-
to-highperformance-scalable-apis-codetalks-2015
TO GO FURTHER