SlideShare uma empresa Scribd logo
1 de 49
Paulo Sousa
2019
INTRODUCTION TO
MICROSERVICES
DISCLAIMER
Parts of this presentation are based
on Sam Newman’s workshop
“Designing Microservices” @ NDC
Porto 2019
WHAT ARE
MICROSERVICES?
Small independently
deployable services that
work together, modelled
around a business
domain
SMALL
Size is not the actual point!
not as big as a server app that
needs to be built and deployed
as a single block
Manageable units of
functionality and deployability
V4
V2
V5
V2
V3
V1
INDEPENDENTLY DEPLOYABLE
No lock-step build and
deployment
Avoiding the “Distributed
Monolith”
https://martinfowler.com/articles/microservices.html
Any organization that designs a system (defined broadly)
will produce a design whose structure is a copy of the
organization's communication structure.
-- Melvyn Conway, 1967
WORK TOGETHER
BUSINESS DOMAIN
https://martinfowler.com/bliki/BoundedContext.html
THE PROMISE
V1
V1
V1
V1
V1
V1
In the begining
everything works fine
But happens.
Fortunatelly, no one else
needs to know about it.
V2
V1
V1
V1
V1
V1
And it happens again V2
V2
V1
V1
V2
V1
And we also want to
refactor and update the
technology stack
V3
V2
V2
V1
V3
V1
And enhance the service V4
V2
V2
V1
V3
V1
And scale the parts of the
system that really need
extra power
V4
V2
V2
V1
V3
V1
And seamingly add new
features
V4
V2
V2
V2
V3
V1
V1
Recommend
And all goes well in the V4
V2
V3
V2
V3
V1
V1
Recommend
BENEFITS
• Focus on one thing and do it right
• Organizational alignment
• Release functionality faster
• Independent scaling
• Technology diversity; Adopt technologies faster
• Enable security concern segregation
• Enable resiliency by designing for failure
But…
REQUIRES
V4
V2
V3
V2
V3
V1
V1
Recommend
• Automation
• High cohesion
• Loose coupling
• Stable versioned APIs
a.k.a. Maturity
HIGH
COHESION
Business cohesion
Things that change together, stay
together
LOOSE
COUPLING
Implementation coupling
Domain coupling
Temporal coupling
DOWNSIDES
• Cognitive overloading (many tooling options)
• Cognitive overloading (system understanding)
• Testing is more complicated
• Monitoring is more complex
• Operational overhead
• Resiliency isn’t free
So we must
remember
Microservices
are about
problems at
scale
# of developers
# of features
# of users
MICROSERVICES ARE
NOT THE GOAL.
IT IS A PATH TO ACHIEVE
A BUSINESS OBJECTIVE
EMBRACE
Eventual
consistency
Data redundancy
& caching
No single
cannonical model
Long running
transactions
ARE THEY USEFUL
FOR “US”?
Truth is,
Most problem-contexts don’t (usually) have
a “scale problem”
However, there are several potential seams
Calculations Partners
Users &
Authorizations
Customers Business processes
Document
management &
printing
Widgets …
DESIGNING AND
ARCHITECTING
If we decide to build it
IDENTIFYING SERVICE BOUNDARIES
https://docs.microsoft.com/en-us/azure/architecture/microservices/model/domain-analysis
THE MICROSERVICES DESIGN CANVAS
Matt Mclarty, Irakli Nadareishvili (2017)
THE MICROSERVICES DESIGN CANVAS
Matt Mclarty, Irakli Nadareishvili (2017)
Each
microservice
owns the end-
to-end
Even the UI & data store!
MICROSERVICES AND THE UI
SINGLE PAGE APPLICATIONS COMPOSITE UI ASSEMBLY
SAGAS, COMPENSATING TRANSACTIONS
• Orchestration
https://docs.microsoft.com/en-us/azure/architecture/patterns/compensating-transaction
SAGAS, COMPENSATING TRANSACTIONS
CHOREOGRAPHY ORCHESTRATION
https://microservices.io/patterns/data/saga.html
https://docs.microsoft.com/en-us/azure/architecture/guide/architecture-styles/microservices
From monolith to
microservice
https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/architect-microservice-container-applications/microservices-architecture
https://cloudacademy.com/learning-paths/dotnet-monolithic-to-microservices-migration-284/
THE STRANGLER PATTERN
http://mycloudcomputing2017.blogspot.com/2017/02/what-is-strangler-application-pattern.html
SUMMING UP
microservices
• Are not the goal
• Are about problems at scale
• Are manageable units of functionality and
deployability
• Own the end-to-end
• Require automation and maturity
REFERENCES
REFERENCES
• Sam Newman (2014) Building Microservices. O’Reilly Media.
• James Lewis, Martin Fowler (2014) Microservices – a definition of this new
architectural term. https://martinfowler.com/articles/microservices.html
• Martin fowler (2015) Microservices trade-offs.
https://martinfowler.com/articles/microservice-trade-offs.html
• Martin Fowler (2014) Bounded context.
https://martinfowler.com/bliki/BoundedContext.html
• Microsoft. Microservices architecture. https://docs.microsoft.com/en-
us/dotnet/standard/microservices-architecture/architect-microservice-
container-applications/microservices-architecture
• Microsoft. Microservices architecture style.
https://docs.microsoft.com/en-us/azure/architecture/guide/architecture-
styles/microservices
REFERENCES
• Matt Mclarty, Irakli Nadareishvili (2017) Streamlined Microservice Design
in Practice. In The DZone guide to Micoservices, vol 1.
https://dzone.com/storage/assets/7852543-dzone-microservicesguide-
2017.pdf
• Susan Fowler (2016) Production-ready Microservices. O’Reilly Media.
• IBM. Microservices for fast time to market and improved app quality.
https://www.ibm.com/cloud/garage/architectures/microservices
• IBM. Refactoring application code to microservices.
https://www.ibm.com/cloud/garage/practices/code/refactor-to-
microservices
• Nick Vennaro (2017) How to introduce microservices in a legacy
environment. https://www.infoworld.com/article/3237175/how-to-
introduce-microservices-in-a-legacy-environment.html

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principles
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To Microservices
 
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Why Microservices
Why MicroservicesWhy Microservices
Why Microservices
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
 
Microservices Tutorial for Beginners | Microservices Architecture | Microserv...
Microservices Tutorial for Beginners | Microservices Architecture | Microserv...Microservices Tutorial for Beginners | Microservices Architecture | Microserv...
Microservices Tutorial for Beginners | Microservices Architecture | Microserv...
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring Boot
 
Micro services vs Monolith Architecture
Micro services vs Monolith ArchitectureMicro services vs Monolith Architecture
Micro services vs Monolith Architecture
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService Architecture
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
What are Microservices | Microservices Architecture Training | Microservices ...
What are Microservices | Microservices Architecture Training | Microservices ...What are Microservices | Microservices Architecture Training | Microservices ...
What are Microservices | Microservices Architecture Training | Microservices ...
 
Microservices
MicroservicesMicroservices
Microservices
 

Semelhante a Introduction to microservices

Semelhante a Introduction to microservices (20)

Microservices and OSGi: Better together?
Microservices and OSGi: Better together?Microservices and OSGi: Better together?
Microservices and OSGi: Better together?
 
Microsoft Microservices
Microsoft MicroservicesMicrosoft Microservices
Microsoft Microservices
 
Building cloud-ready Microservices
Building cloud-ready MicroservicesBuilding cloud-ready Microservices
Building cloud-ready Microservices
 
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
 
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHYSELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
 
Nab 2017 a journey to the future of cloud-native media micro-services - was...
Nab 2017   a journey to the future of cloud-native media micro-services - was...Nab 2017   a journey to the future of cloud-native media micro-services - was...
Nab 2017 a journey to the future of cloud-native media micro-services - was...
 
FORUM PA 2015 - Microservices with IBM Bluemix
FORUM PA 2015 - Microservices with IBM BluemixFORUM PA 2015 - Microservices with IBM Bluemix
FORUM PA 2015 - Microservices with IBM Bluemix
 
Vancouver Microservices Meetup - Kickoff Session
Vancouver Microservices Meetup - Kickoff SessionVancouver Microservices Meetup - Kickoff Session
Vancouver Microservices Meetup - Kickoff Session
 
Enable rapid service provisioning with cics, microservices and the z/OS Provi...
Enable rapid service provisioning with cics, microservices and the z/OS Provi...Enable rapid service provisioning with cics, microservices and the z/OS Provi...
Enable rapid service provisioning with cics, microservices and the z/OS Provi...
 
JavaOne 2015: 14 Key Lessons, you should learn
JavaOne 2015: 14 Key Lessons, you should learnJavaOne 2015: 14 Key Lessons, you should learn
JavaOne 2015: 14 Key Lessons, you should learn
 
Let's talk about... Microservices
Let's talk about... MicroservicesLet's talk about... Microservices
Let's talk about... Microservices
 
Better Software—Faster: Ten Best Practices from Sequoia's Microservices Summit
Better Software—Faster: Ten Best Practices from Sequoia's Microservices SummitBetter Software—Faster: Ten Best Practices from Sequoia's Microservices Summit
Better Software—Faster: Ten Best Practices from Sequoia's Microservices Summit
 
CWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der walCWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der wal
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
Architecting for speed: How agile innovators accelerate growth through micros...
Architecting for speed: How agile innovators accelerate growth through micros...Architecting for speed: How agile innovators accelerate growth through micros...
Architecting for speed: How agile innovators accelerate growth through micros...
 
Architecting for speed - how agile innovators accelerate growth through micro...
Architecting for speed - how agile innovators accelerate growth through micro...Architecting for speed - how agile innovators accelerate growth through micro...
Architecting for speed - how agile innovators accelerate growth through micro...
 
Pitfalls & Challenges Faced During a Microservices Architecture Implementation
Pitfalls & Challenges Faced During a Microservices Architecture ImplementationPitfalls & Challenges Faced During a Microservices Architecture Implementation
Pitfalls & Challenges Faced During a Microservices Architecture Implementation
 
Microservice final final
Microservice final finalMicroservice final final
Microservice final final
 
Microservices
MicroservicesMicroservices
Microservices
 
Displacing the Programmers
Displacing the Programmers Displacing the Programmers
Displacing the Programmers
 

Mais de Paulo Gandra de Sousa

Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)
Paulo Gandra de Sousa
 

Mais de Paulo Gandra de Sousa (20)

Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Minds-on DDD
Minds-on DDDMinds-on DDD
Minds-on DDD
 
Benefits of Hypermedia API
Benefits of Hypermedia APIBenefits of Hypermedia API
Benefits of Hypermedia API
 
Design Patterns: From STUPID to SOLID code
Design Patterns: From STUPID to SOLID codeDesign Patterns: From STUPID to SOLID code
Design Patterns: From STUPID to SOLID code
 
Design Patterns: Back to Basics
Design Patterns: Back to BasicsDesign Patterns: Back to Basics
Design Patterns: Back to Basics
 
Hypermedia APIs
Hypermedia APIsHypermedia APIs
Hypermedia APIs
 
RESTful services Design Lab
RESTful services Design LabRESTful services Design Lab
RESTful services Design Lab
 
Principles of Service Orientation
Principles of Service OrientationPrinciples of Service Orientation
Principles of Service Orientation
 
OO design principles and patterns
OO design principles and patternsOO design principles and patterns
OO design principles and patterns
 
Modern web architectural patterns
Modern web architectural patternsModern web architectural patterns
Modern web architectural patterns
 
REST beyond CRUD
REST beyond CRUDREST beyond CRUD
REST beyond CRUD
 
Revision control with Mercurial
Revision control with MercurialRevision control with Mercurial
Revision control with Mercurial
 
Rest web services
Rest web servicesRest web services
Rest web services
 
Lição prova professor coordenador
Lição prova professor coordenadorLição prova professor coordenador
Lição prova professor coordenador
 
Documenting Software Architectures
Documenting Software ArchitecturesDocumenting Software Architectures
Documenting Software Architectures
 
Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)
 
Software Product Lines
Software Product LinesSoftware Product Lines
Software Product Lines
 
PoEAA by Example
PoEAA by ExamplePoEAA by Example
PoEAA by Example
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration Patterns
 
Patterns for distributed systems
Patterns for distributed systemsPatterns for distributed systems
Patterns for distributed systems
 

Último

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Último (20)

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 

Introduction to microservices

Notas do Editor

  1. See also https://www.slideshare.net/masashin/designing-microservices/13 Finding service boundary • Start with bounded context • Further breakdown per non-functional requirements • Vertical decomposition rather than horizontal (layers) • Also consider • Rate of change • Technology used • Communication overhead • Splitting data is challenge due to consistency issues • Refactoring across boundary is an extremely expensive operation
  2. https://docs.microsoft.com/en-us/azure/architecture/microservices/model/domain-analysis https://docs.microsoft.com/en-us/azure/architecture/microservices/model/microservice-boundaries
  3. API gateway handles authentication; inside the microservices zone there is no need for authentication; it is a trusted zone Logging, Caching Throtling Retry Circuit breaker/strangler