SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
A Tale of Two Microservices
Pablo Chacin
@pablochacin
Who is talking
20+ years experience
CTO of a startup
PhD in Distributed Systems
Software Architect
All things backend nut
Bare-hand developer (have an
issue with frameworks)
Retro-futuristic technology
observer
Most of the industry feels like …
But this time we are going to use microservices
We have this new project, with tight deadlines
And we are going to rule ….
But things are more likely to end like this
Are we talking about the same?
So, I’m doing this
microservices
stuff ...
Yeah, you mean
REST api and
containers,
right?
This is not an ideological
debate
It is a journey to explore the
two dominant microservice
approaches
Expect to clarify concepts and
help in making sound design
decisions.
What is this talk about
Microservice Architecture
describes a particular way
of designing software
applications
There are certain common
characteristics
There is no precise definition
of this architectural style
Martin Fowler
Back to the basics
Independently deployable
Organized around Business
Capabilities
Smart endpoints and dumb
pipes
Decentralized Governance
Decentralized Data
Management
Infrastructure Automation
Just SOA by another name?
Complex applications are
composed of small,
independent services
communicating with each
other using APIs.
These services are small,
highly decoupled and focus
on doing a small task
Decoupled? That’s just like your opinion, man
Coupling
Services that interact with
others suffer differents types of
coupling
Time (synchronization)
Location (binding)
Knowledge (schema)
Control (orchestration)
Context (transactions)
State (persistence)
Exactly, what could possibly go Wrong?
Law of conservation of complexity
“When we break big things
into small pieces we
invariably push the
complexity to their
interactions”
Michael Feathers
https://michaelfeathers.silvrback.com/microservices-until-macro-complexity
What we can learn from the (recent) past
“I predicted that in the next
few years all the suite of
WS-* standards will be re-
invented for micro services,
and it will be the fourth time
I have seen such a set of
standards being re-
invented” - Greg Young
How to decouple services?
Microservices - Services the Unix Way
“Write programs that do one
thing and do it well. Write
programs to work together.
Write programs to handle
text streams, because that
is a universal interface”
Doug McIlroy
Know your services
A Service is the authority for
a given business capability
everywhere:
Owns of all the data that
support this business
capability
Enforces business rules
Is autonomous: does not
rely on any other service
Service boundaries
Define service data
boundaries so that
consistency can be achieved
within one service but is not
necessary between services
Most transactionality
problems can be solved by
looking at the use case and
re-evaluating the consistency
thesis
Event based communication
Asynchronous signaling by
means of events
Events != messaging
log files anyone?
No global transactions
No coupling
No shared state
Sagas: distributed coordination without transactions
A coordinator of long-running
processes
Subscribe to relevant events
from multiple services
Keep process’ progress state
Triggers new events to drive
process work flow
Emits compensating events
to handle failures
One brief example
A typical order fulfillment system
(source: Microservices: It’s not (only) the size that matters, it’s (also) how you use them by Jeppe Cramon)
An example
(taken from Microservices: It’s not (only) the size that matters, it’s (also) how you use them by Jeppe
Cramon)
Complex Service UI Integration
(taken from Microservices: It’s not (only) the size that matters, it’s (also) how you use them – part 5 by
Jeppe Cramon)
Traditional service mashups
just shifts service coupling
one layer up to to UI
If services own data
everywhere, they must
supply also a display of this
data
Platform specific apps (IOS,
Android) poses a challenge
I strongly recommend
reading “Microservices:
It’s not (only) the size
that matters, it’s (also)
how you use them”, a
series of articles by
Jeppe Cramon
Kudos
https://www.tigerteam.dk/2014/micro-services-its-not-only-the-size-that-matters-its-
also-how-you-use-them-part-1/
Conclusions
“Life is pain. Anyone
saying differently is
selling something”
Iñigo Montoya
Questions? … Thanks!

Mais conteúdo relacionado

Mais de distributed matters

Mais de distributed matters (11)

NoSQL meets Microservices - Michael Hackstein
NoSQL meets Microservices -  Michael HacksteinNoSQL meets Microservices -  Michael Hackstein
NoSQL meets Microservices - Michael Hackstein
 
Actors evolved- Rotem Hermon
Actors evolved- Rotem HermonActors evolved- Rotem Hermon
Actors evolved- Rotem Hermon
 
Replication and Synchronization Algorithms for Distributed Databases - Lena W...
Replication and Synchronization Algorithms for Distributed Databases - Lena W...Replication and Synchronization Algorithms for Distributed Databases - Lena W...
Replication and Synchronization Algorithms for Distributed Databases - Lena W...
 
Conflict resolution with guns - Mark Nadal
Conflict resolution with guns - Mark NadalConflict resolution with guns - Mark Nadal
Conflict resolution with guns - Mark Nadal
 
A tale of queues — from ActiveMQ over Hazelcast to Disque - Philipp Krenn
A tale of queues — from ActiveMQ over Hazelcast to Disque - Philipp KrennA tale of queues — from ActiveMQ over Hazelcast to Disque - Philipp Krenn
A tale of queues — from ActiveMQ over Hazelcast to Disque - Philipp Krenn
 
NoSQL's biggest lie: SQL never went away - Martin Esmann
NoSQL's biggest lie: SQL never went away - Martin EsmannNoSQL's biggest lie: SQL never went away - Martin Esmann
NoSQL's biggest lie: SQL never went away - Martin Esmann
 
NoSQL meets Microservices - Michael Hackstein
NoSQL meets Microservices - Michael HacksteinNoSQL meets Microservices - Michael Hackstein
NoSQL meets Microservices - Michael Hackstein
 
No Free Lunch, Indeed: Three Years of Microservices at SoundCloud - Phil Calcado
No Free Lunch, Indeed: Three Years of Microservices at SoundCloud - Phil CalcadoNo Free Lunch, Indeed: Three Years of Microservices at SoundCloud - Phil Calcado
No Free Lunch, Indeed: Three Years of Microservices at SoundCloud - Phil Calcado
 
Disque: a detailed overview of the distributed implementation - Salvatore San...
Disque: a detailed overview of the distributed implementation - Salvatore San...Disque: a detailed overview of the distributed implementation - Salvatore San...
Disque: a detailed overview of the distributed implementation - Salvatore San...
 
Microservices - stress-free and without increased heart-attack risk - Uwe Fri...
Microservices - stress-free and without increased heart-attack risk - Uwe Fri...Microservices - stress-free and without increased heart-attack risk - Uwe Fri...
Microservices - stress-free and without increased heart-attack risk - Uwe Fri...
 
Microservices with Netflix OSS & Spring Cloud - Arnaud Cogoluègnes
 Microservices with Netflix OSS & Spring Cloud - Arnaud Cogoluègnes Microservices with Netflix OSS & Spring Cloud - Arnaud Cogoluègnes
Microservices with Netflix OSS & Spring Cloud - Arnaud Cogoluègnes
 

Último

Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
shivangimorya083
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
amitlee9823
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
shivangimorya083
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
MarinCaroMartnezBerg
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
Lars Albertsson
 

Último (20)

Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 

A tale of two microservices - Pablo Chacin

  • 1. A Tale of Two Microservices Pablo Chacin @pablochacin
  • 2. Who is talking 20+ years experience CTO of a startup PhD in Distributed Systems Software Architect All things backend nut Bare-hand developer (have an issue with frameworks) Retro-futuristic technology observer
  • 3. Most of the industry feels like … But this time we are going to use microservices We have this new project, with tight deadlines And we are going to rule ….
  • 4. But things are more likely to end like this
  • 5. Are we talking about the same? So, I’m doing this microservices stuff ... Yeah, you mean REST api and containers, right?
  • 6. This is not an ideological debate It is a journey to explore the two dominant microservice approaches Expect to clarify concepts and help in making sound design decisions. What is this talk about
  • 7. Microservice Architecture describes a particular way of designing software applications There are certain common characteristics There is no precise definition of this architectural style Martin Fowler Back to the basics Independently deployable Organized around Business Capabilities Smart endpoints and dumb pipes Decentralized Governance Decentralized Data Management Infrastructure Automation
  • 8. Just SOA by another name? Complex applications are composed of small, independent services communicating with each other using APIs. These services are small, highly decoupled and focus on doing a small task
  • 9. Decoupled? That’s just like your opinion, man
  • 10. Coupling Services that interact with others suffer differents types of coupling Time (synchronization) Location (binding) Knowledge (schema) Control (orchestration) Context (transactions) State (persistence)
  • 11. Exactly, what could possibly go Wrong?
  • 12. Law of conservation of complexity “When we break big things into small pieces we invariably push the complexity to their interactions” Michael Feathers https://michaelfeathers.silvrback.com/microservices-until-macro-complexity
  • 13. What we can learn from the (recent) past “I predicted that in the next few years all the suite of WS-* standards will be re- invented for micro services, and it will be the fourth time I have seen such a set of standards being re- invented” - Greg Young
  • 14. How to decouple services?
  • 15. Microservices - Services the Unix Way “Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface” Doug McIlroy
  • 16. Know your services A Service is the authority for a given business capability everywhere: Owns of all the data that support this business capability Enforces business rules Is autonomous: does not rely on any other service
  • 17. Service boundaries Define service data boundaries so that consistency can be achieved within one service but is not necessary between services Most transactionality problems can be solved by looking at the use case and re-evaluating the consistency thesis
  • 18. Event based communication Asynchronous signaling by means of events Events != messaging log files anyone? No global transactions No coupling No shared state
  • 19. Sagas: distributed coordination without transactions A coordinator of long-running processes Subscribe to relevant events from multiple services Keep process’ progress state Triggers new events to drive process work flow Emits compensating events to handle failures
  • 21. A typical order fulfillment system (source: Microservices: It’s not (only) the size that matters, it’s (also) how you use them by Jeppe Cramon)
  • 22. An example (taken from Microservices: It’s not (only) the size that matters, it’s (also) how you use them by Jeppe Cramon)
  • 23. Complex Service UI Integration (taken from Microservices: It’s not (only) the size that matters, it’s (also) how you use them – part 5 by Jeppe Cramon) Traditional service mashups just shifts service coupling one layer up to to UI If services own data everywhere, they must supply also a display of this data Platform specific apps (IOS, Android) poses a challenge
  • 24. I strongly recommend reading “Microservices: It’s not (only) the size that matters, it’s (also) how you use them”, a series of articles by Jeppe Cramon Kudos https://www.tigerteam.dk/2014/micro-services-its-not-only-the-size-that-matters-its- also-how-you-use-them-part-1/
  • 25. Conclusions “Life is pain. Anyone saying differently is selling something” Iñigo Montoya