SlideShare a Scribd company logo
1 of 19
Microservices from the
Trenches
Adrian Bolboacă
A preachy stream of consciousness about
business, analysis, architecture and code
Architecture - Strategy
No strategy is perfect
No strategy makes sense without the detailed tactics.
Programming - Tactics
Difficult to have an overview when being only tactical
Common mistake: starting with tactics without having a strategy
There is no silver bullet
There is no recipe
There can be guidelines.
Microservices is a strategy useful for
● Parallelizing work for faster time to market (James Lewis) -
- it needs more architecting and planning up-front
● Non-homogenous set of programming languages (James Lewis)
- you can write each microservice is any language
● Increased scalability, especially with cloud computing (Adrian Cockroft)
● Parallel versioning (Fred George)
● Self-contained systems (Sam Newman)
● Self-healing systems
Microservices is a bad strategy when
● The boss wants the new hype
● There is no need to scale
● Only one portion of the big ball of mud (monolith) needs to scale
● The team is not proficient enough in architecture and domain modelling
● There is not enough organizational support for a paradigm change
Risks with microservices
● Dependency hell, when not architected well
● Increased operational costs
● Difficult debugging
● More complex security
● Distributed systems
Exercise - 5 minutes
Draw your system as it would tell a story about what it does
No technical terms allowed, only business.
Traps
Traps 1/2
● Difficult to understand where to "cut" the domain
● May generate systems more difficult to work with than a monolith because of
shotgun architecture
● Using any programming language and any technology can lead to having all of
them in a few years, and nobody knows anymore how to change that (Spotify)
● Less focus on unit testing may lead to no automated testing, and relying on
production testing (client testing)
Traps 2/2
● Starting with no architecture (because we are agile), and rewriting the system
every 2-3 years to fix it
● Macro-micro-services: not small enough -> all is dependent by all others
● Calling microservices directly instead of using events / messages
● Sharing data in-between microservices (not self-contained -> high coupling)
Some Theory
Conway's Law
"organizations which design systems (in the broad sense used here) are constrained to
produce designs which are copies of the communication structures of these
organizations" Melvin Conway, “How do committees invent”, 1968 (Wikipedia)
● Microservices can take advantage of Conway’s law
● Complete decoupling => less communication => independent, parallel
development
● Microservices enable developing a product with multiple teams in parallel
CAP Theorem
“It is impossible for a distributed data store to simultaneously provide more than two
out of the following three guarantees:
Consistency: Every read receives the most recent write or an error
Availability: Every request receives a (non-error) response – without the guarantee
that it contains the most recent write
Partition tolerance: The system continues to operate despite an arbitrary number of
messages being dropped (or delayed) by the network between nodes” (Wikipedia)
CAP Theorem -> Eventual Consistency
Basically Available: basic reading and writing operations are available as much as
possible, but without any kind of consistency guarantees
Soft state: without consistency guarantees, after some amount of time, we only
have some probability of knowing the state, since it may not yet have converged
Eventually consistent: If the system is functioning and we wait long enough after
any given set of inputs, we will eventually be able to know what the state of the
database is, and so any further reads will be consistent with our expectations
(Wikipedia)
Microservices hype made
programmers more aware of
methods to modularise large
monolithic systems, because of
stricter component boundaries
Advice
1. Add more importance of principles like modularity, loose coupling, high
cohesion, changeability, scalability, fault tolerance, resilience, testing, etc.
2. Never re-architect a system into microservices without making domain
modelling first. Delete and repeat. A few times. Use Domain Modelling Kata
3. Always invite all the roles when modelling your domain
architect, product, programmer, tester, security, ops, etc
4. Never re-architect at once the whole the system.
Extract parts, one by one and always ask: is it enough? Can we stop?
5. Logging & Error Management: start having them from the very beginning
What's Next
1 Practice
Architectural Kata - exercise
your architecture post
Domain Modelling Kata -
exercise your modelling post
Architecting Microservices
workshop shameless
promotion
2 Read
Sam Newman - Building
Microservices book
James Lewis - Microservices
Architecture article
Eric Evans - Domain Driven
Design book
3 Watch
Martin Fowler - Microservices
video
James Lewis - Systems that
are #neverdone video
Chris Richardson –
Microservice Patterns video
Adrian Bolboacă
Blog https://blog.adrianbolboaca.ro
Youtube https://youtube.com/adibolboaca
Think. Design. Work Smart.
https://www.youtube.com/channel/UCSEkgmzFb4PnaGAVXt
K8dGA
Works at https://mozaicworks.com
Follow-up adrian.bolboaca@mozaicworks.com
Follow-up https://twitter.com/adibolb
VP of Innovation in Education and Technology @Mozaic Works
Thank you

More Related Content

More from Adi Bolboaca

Coderetreat @AgileFinland Tampere 2014 11 12
Coderetreat @AgileFinland Tampere 2014 11 12Coderetreat @AgileFinland Tampere 2014 11 12
Coderetreat @AgileFinland Tampere 2014 11 12
Adi Bolboaca
 
TDD Mini Workshop @ Bucharest JUG 2014 04 24
TDD Mini Workshop @ Bucharest JUG 2014 04 24TDD Mini Workshop @ Bucharest JUG 2014 04 24
TDD Mini Workshop @ Bucharest JUG 2014 04 24
Adi Bolboaca
 
Coderetreat Slides on the Global Day of Coderetreat, Bucharest, December 2013
Coderetreat Slides on the Global Day of Coderetreat, Bucharest, December 2013Coderetreat Slides on the Global Day of Coderetreat, Bucharest, December 2013
Coderetreat Slides on the Global Day of Coderetreat, Bucharest, December 2013
Adi Bolboaca
 
Coderetreat @AgileWorks Bucharest 2012 07 06
Coderetreat @AgileWorks Bucharest 2012 07 06 Coderetreat @AgileWorks Bucharest 2012 07 06
Coderetreat @AgileWorks Bucharest 2012 07 06
Adi Bolboaca
 
Legacy Coderetreat @Budapest 2013 02 16
Legacy Coderetreat @Budapest 2013 02 16Legacy Coderetreat @Budapest 2013 02 16
Legacy Coderetreat @Budapest 2013 02 16
Adi Bolboaca
 
Coderetreat @Sofia 2012 10 27
Coderetreat @Sofia 2012 10 27Coderetreat @Sofia 2012 10 27
Coderetreat @Sofia 2012 10 27
Adi Bolboaca
 
Coderetreat @Turku 2012 10 20
Coderetreat @Turku 2012 10 20 Coderetreat @Turku 2012 10 20
Coderetreat @Turku 2012 10 20
Adi Bolboaca
 
Coderetreat @Sibiu 2012 08 18
Coderetreat @Sibiu 2012 08 18Coderetreat @Sibiu 2012 08 18
Coderetreat @Sibiu 2012 08 18
Adi Bolboaca
 
Coderetreat @Vienna 2013 06 08
Coderetreat @Vienna 2013 06 08Coderetreat @Vienna 2013 06 08
Coderetreat @Vienna 2013 06 08
Adi Bolboaca
 

More from Adi Bolboaca (14)

Coderetreat @AgileFinland Tampere 2014 11 12
Coderetreat @AgileFinland Tampere 2014 11 12Coderetreat @AgileFinland Tampere 2014 11 12
Coderetreat @AgileFinland Tampere 2014 11 12
 
Refactoring Dojo @AgileWorks Bucharest 21 May 2014
Refactoring Dojo @AgileWorks Bucharest 21 May 2014Refactoring Dojo @AgileWorks Bucharest 21 May 2014
Refactoring Dojo @AgileWorks Bucharest 21 May 2014
 
Sherlock Holmes and Pairing @Romanian Testing Conference 2014 05 15
Sherlock Holmes and Pairing @Romanian Testing Conference 2014 05 15Sherlock Holmes and Pairing @Romanian Testing Conference 2014 05 15
Sherlock Holmes and Pairing @Romanian Testing Conference 2014 05 15
 
TDD Mini Workshop @ Bucharest JUG 2014 04 24
TDD Mini Workshop @ Bucharest JUG 2014 04 24TDD Mini Workshop @ Bucharest JUG 2014 04 24
TDD Mini Workshop @ Bucharest JUG 2014 04 24
 
Coderetreat Slides on the Global Day of Coderetreat, Bucharest, December 2013
Coderetreat Slides on the Global Day of Coderetreat, Bucharest, December 2013Coderetreat Slides on the Global Day of Coderetreat, Bucharest, December 2013
Coderetreat Slides on the Global Day of Coderetreat, Bucharest, December 2013
 
Sherlock Holmes and Pairing @Bucharest JUG 2013 11 21
Sherlock Holmes and Pairing @Bucharest JUG 2013 11 21Sherlock Holmes and Pairing @Bucharest JUG 2013 11 21
Sherlock Holmes and Pairing @Bucharest JUG 2013 11 21
 
Sherlock Holmes and Pairing @Wlidcard Conference 2013 09 13
Sherlock Holmes and Pairing @Wlidcard Conference 2013 09 13Sherlock Holmes and Pairing @Wlidcard Conference 2013 09 13
Sherlock Holmes and Pairing @Wlidcard Conference 2013 09 13
 
Code retreat @AgileWorks Bucharest 7 September 2013
Code retreat @AgileWorks Bucharest 7 September 2013Code retreat @AgileWorks Bucharest 7 September 2013
Code retreat @AgileWorks Bucharest 7 September 2013
 
Coderetreat @AgileWorks Bucharest 2012 07 06
Coderetreat @AgileWorks Bucharest 2012 07 06 Coderetreat @AgileWorks Bucharest 2012 07 06
Coderetreat @AgileWorks Bucharest 2012 07 06
 
Legacy Coderetreat @Budapest 2013 02 16
Legacy Coderetreat @Budapest 2013 02 16Legacy Coderetreat @Budapest 2013 02 16
Legacy Coderetreat @Budapest 2013 02 16
 
Coderetreat @Sofia 2012 10 27
Coderetreat @Sofia 2012 10 27Coderetreat @Sofia 2012 10 27
Coderetreat @Sofia 2012 10 27
 
Coderetreat @Turku 2012 10 20
Coderetreat @Turku 2012 10 20 Coderetreat @Turku 2012 10 20
Coderetreat @Turku 2012 10 20
 
Coderetreat @Sibiu 2012 08 18
Coderetreat @Sibiu 2012 08 18Coderetreat @Sibiu 2012 08 18
Coderetreat @Sibiu 2012 08 18
 
Coderetreat @Vienna 2013 06 08
Coderetreat @Vienna 2013 06 08Coderetreat @Vienna 2013 06 08
Coderetreat @Vienna 2013 06 08
 

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
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
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
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
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
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
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
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
 
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
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 

2020 0116 Microservices from the trenches

  • 1. Microservices from the Trenches Adrian Bolboacă A preachy stream of consciousness about business, analysis, architecture and code
  • 2. Architecture - Strategy No strategy is perfect No strategy makes sense without the detailed tactics. Programming - Tactics Difficult to have an overview when being only tactical Common mistake: starting with tactics without having a strategy
  • 3. There is no silver bullet There is no recipe There can be guidelines.
  • 4. Microservices is a strategy useful for ● Parallelizing work for faster time to market (James Lewis) - - it needs more architecting and planning up-front ● Non-homogenous set of programming languages (James Lewis) - you can write each microservice is any language ● Increased scalability, especially with cloud computing (Adrian Cockroft) ● Parallel versioning (Fred George) ● Self-contained systems (Sam Newman) ● Self-healing systems
  • 5. Microservices is a bad strategy when ● The boss wants the new hype ● There is no need to scale ● Only one portion of the big ball of mud (monolith) needs to scale ● The team is not proficient enough in architecture and domain modelling ● There is not enough organizational support for a paradigm change
  • 6. Risks with microservices ● Dependency hell, when not architected well ● Increased operational costs ● Difficult debugging ● More complex security ● Distributed systems
  • 7. Exercise - 5 minutes Draw your system as it would tell a story about what it does No technical terms allowed, only business.
  • 9. Traps 1/2 ● Difficult to understand where to "cut" the domain ● May generate systems more difficult to work with than a monolith because of shotgun architecture ● Using any programming language and any technology can lead to having all of them in a few years, and nobody knows anymore how to change that (Spotify) ● Less focus on unit testing may lead to no automated testing, and relying on production testing (client testing)
  • 10. Traps 2/2 ● Starting with no architecture (because we are agile), and rewriting the system every 2-3 years to fix it ● Macro-micro-services: not small enough -> all is dependent by all others ● Calling microservices directly instead of using events / messages ● Sharing data in-between microservices (not self-contained -> high coupling)
  • 12. Conway's Law "organizations which design systems (in the broad sense used here) are constrained to produce designs which are copies of the communication structures of these organizations" Melvin Conway, “How do committees invent”, 1968 (Wikipedia) ● Microservices can take advantage of Conway’s law ● Complete decoupling => less communication => independent, parallel development ● Microservices enable developing a product with multiple teams in parallel
  • 13. CAP Theorem “It is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees: Consistency: Every read receives the most recent write or an error Availability: Every request receives a (non-error) response – without the guarantee that it contains the most recent write Partition tolerance: The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes” (Wikipedia)
  • 14. CAP Theorem -> Eventual Consistency Basically Available: basic reading and writing operations are available as much as possible, but without any kind of consistency guarantees Soft state: without consistency guarantees, after some amount of time, we only have some probability of knowing the state, since it may not yet have converged Eventually consistent: If the system is functioning and we wait long enough after any given set of inputs, we will eventually be able to know what the state of the database is, and so any further reads will be consistent with our expectations (Wikipedia)
  • 15. Microservices hype made programmers more aware of methods to modularise large monolithic systems, because of stricter component boundaries
  • 16. Advice 1. Add more importance of principles like modularity, loose coupling, high cohesion, changeability, scalability, fault tolerance, resilience, testing, etc. 2. Never re-architect a system into microservices without making domain modelling first. Delete and repeat. A few times. Use Domain Modelling Kata 3. Always invite all the roles when modelling your domain architect, product, programmer, tester, security, ops, etc 4. Never re-architect at once the whole the system. Extract parts, one by one and always ask: is it enough? Can we stop? 5. Logging & Error Management: start having them from the very beginning
  • 17. What's Next 1 Practice Architectural Kata - exercise your architecture post Domain Modelling Kata - exercise your modelling post Architecting Microservices workshop shameless promotion 2 Read Sam Newman - Building Microservices book James Lewis - Microservices Architecture article Eric Evans - Domain Driven Design book 3 Watch Martin Fowler - Microservices video James Lewis - Systems that are #neverdone video Chris Richardson – Microservice Patterns video
  • 18. Adrian Bolboacă Blog https://blog.adrianbolboaca.ro Youtube https://youtube.com/adibolboaca Think. Design. Work Smart. https://www.youtube.com/channel/UCSEkgmzFb4PnaGAVXt K8dGA Works at https://mozaicworks.com Follow-up adrian.bolboaca@mozaicworks.com Follow-up https://twitter.com/adibolb VP of Innovation in Education and Technology @Mozaic Works

Editor's Notes

  1. Debrief: if your system appears coherent, it was designed with business in mind