Microservices Architecture
Luiz Fernando Signorelli
Definition
“Microservices - also known as the
microservice architecture - is an
architectural style that structures an
application as a collection of loosely
coupled services, which implement
business capabilities”
- microservices.io
“In short, the microservice architectural style is an
approach to developing a single application as a
suite of small services, each running in its own
process and communicating with lightweight
mechanisms, often an HTTP resource API. These
services are built around business capabilities and
independently deployable by fully automated
deployment machinery”
- Martin Fowler
“Microservices is a variant of the service-oriented
architecture (SOA) architectural style that
structures an application as a collection of loosely
coupled services”
- Wikipedia
Why?
Shorter feedback loops
The Monolith
Benefits of the Monolith
● Easy to start
● Easy to understand
● Communication between modules
● Simple to change
● Easy to test
● Good for small teams
● Simple to scale
Drawbacks of the Monolith
● It grows!
● Too big to fit on someone's head
● Deploy becomes challenging
● Simple to change
● Bad for big teams
● Reliability
● Difficult to change the technology stack
Microservices to the rescue
Benefits of Microservices
● Enables teams to be autonomous
● Each service is a small, maintainable application
● Services are independently deployable
● Services are independently scalable
● Easier to adopt new technologies
● Improved fault isolation
Drawbacks of Microservices
● Deciding when to adopt
● How to break down services
● Distributed systems are complex
● Deploying requires careful coordination
● Testing the whole thing is difficult
● Operations
CAP Theorem
If your system can have a network partition
you have to choose between consistency and
availability. The choice boils down to a
business decision.
Don't!First Law of Distributed Object Design
How
12 Factor
Martin Fowler's
Microservices
Prerequisites
Calçados's
Microservices
Prerequisites
1. Rapid provisioning of compute
resources
2. Basic monitoring
3. Rapid deployment
4. Easy to provision storage
5. Easy access to the edge
6. Authentication/Authorisation
7. Standardised RPC
Event Sourcing and CQRS
● Greg Young
● The event log as the source of truth
● Enables async communication
● Automatic Audit
Service Mesh
Service Mesh
● Central log
● Central configuration
● Circuit breaker
● Routing
● Service discovery,
● Tracing
● Metrics
● Linkerd
● Conduit
● Envoy
● Istio
“A service mesh is a dedicated infrastructure layer
for handling service-to-service communication.
It’s responsible for the reliable delivery of
requests through the complex topology of
services that comprise a modern, cloud native
application. In practice, the service mesh is
typically implemented as an array of lightweight
network proxies that are deployed alongside
application code, without the application needing
to be aware.”
- William Morgan, boyant.io
References
Articles
http://philcalcado.com/2017/03/02/microservices_vs_1st_law_distributed_objects.html
http://philcalcado.com/2017/06/11/calcados_microservices_prerequisites.html
http://philcalcado.com/2017/08/03/pattern_service_mesh.html
https://martinfowler.com/articles/distributed-objects-microservices.html
https://martinfowler.com/articles/microservices.html
https://m.signalvnoise.com/the-majestic-monolith-29166d022228
https://buoyant.io/2017/04/25/whats-a-service-mesh-and-why-do-i-need-one/
https://www.confluent.io/blog/messaging-single-source-truth/
http://microservices.io
Presentations
http://www.ustream.tv/recorded/102894375
https://www.infoq.com/presentations/soundcloud-microservices
Books
https://www.manning.com/books/microservices-patterns
Thanks!
Luiz Fernando Signorelli
luiz.sg@gmail.com
@luizsignorelli

Microservices architecture