SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Monoliths and
microservices
Bozhidar Bozhanov
Vanity slide
• Senior software engineer @ TomTom
• http://blog.bozho.net
• http://techblog.bozho.net
• http://twitter.com/bozhobg
• some other stuff...
General architecture
Source: Microsoft
Monoliths
• single deployment
• single runtime
• single codebase
• interaciton between classes is most often
syncrhonous
• most often every layer is in a separate
package
Microservices
• many small modules with specific functionality
• more than one codebase
• every microservice is a separate deployment
• every microservices has its own DB
• communication with web-
services/protobuf/thrift/…
• ensures module independence
Monoliths vs microservices
Source: Martin Fowler
Downsides of monoliths…?
• “spaghetti”, “big ball of mud”
• you need a full redeploy
• programmers often violate the layer
boundaries
• classes often “leak” their implementation
• hard to work with multiple teams
• hard to manage
Benefits of Microservices..?
• modelled around the business domain
• deployment automation culture
• hides implementation details
• decentralization
• option to use multiple languages
• separate deployment, separate monitoring
• isolating problems
Source: Martin Fowler
Downsides of monoliths..?
• “spaghetti”, “big ball of mud”
• if you write bad code, architecture doesn’t matter
• you need a full redeploy
• so? It’s automated anyway
• programmers often violate layers
• see. 1
• classes “leak” their implementation
• see 1
Benefits of microservices..?
• all of them can be achieved with a monolith
• modelled around the business domain
• yes
• deployment automation culture
• nothing stops automated deployments of a monolith
• hides implementation details
• OOP 101
Benefits of microservices..?
• separate deployment, separate мониторинг
• monitoring of classes/components/layers with tools
like statsd
• isolating problems
• when has a single exception broken your server?
• if a whole machine dies – you have an HA cluster
• graceful degradation - feature toggle in monolith
Microservices...downsides
• network overhead
• transaction coordination
• you don’t have transaction? Congratulations.
• need for duplicating common data
• and keeping it in sync
• complicated deployment pipeline
• dependencies
Microservices...should we?
“…don’t even consider microservices unless
you have a system that’s too complex to
manage as a monolith. The majority of software
systems should be built as a single monolithic
application. Do pay attention to good modularity
within that monolith, but don’t try to separate it
into separate services” Martin Fowler
“the design thinking and decomposition
strategy required to create a good
microservices architecture are the same as
those needed to create a well structured
monolith” Simon Brown
The middle way
Source: Simon Brown
How to write monoliths
• package by layer (small projects)
• with sub-packages by component
• package by components
• logically the same as microservices, without the cons
• one or several projects with module dependencies
• project jigsaw - modules
• good OOP
• interfaces, encapsulation, composition, etc.
More best practices
• Continuous delivery, automation
• High availability
• Log collection
• Monitoring
Microservices use cases
• multiple teams
• short-lived, spawned workers
• memory or CPU intensive parts
• to ease development
Но като цяло...
• common sense
• добри практики
• качествен код
• не се доверявайте на “модерното”
• не се “наархитектурчвайте”
• a.k.a. KISS
• загубите може да са повече от евентуалните
ползи
Sources
http://www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html
http://www.codingthearchitecture.com/2013/07/03/aligning_software_architecture_and_code.html
https://michaelfeathers.silvrback.com/microservices-until-macro-complexity
http://techblog.bozho.net/in-defence-of-monoliths/
http://martinfowler.com/bliki/MicroservicePremium.html
http://martinfowler.com/articles/microservices.html
http://martinfowler.com/articles/microservice-trade-offs.html
http://www.wired.com/2015/09/google-2-billion-lines-codeand-one-place/
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to Microservices
 
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...
 
Docker & kubernetes
Docker & kubernetesDocker & kubernetes
Docker & kubernetes
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices
MicroservicesMicroservices
Microservices
 
Micro services vs Monolith Architecture
Micro services vs Monolith ArchitectureMicro services vs Monolith Architecture
Micro services vs Monolith Architecture
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
 
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
 
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
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Monoliths, Migrations, and Microservices
Monoliths, Migrations, and MicroservicesMonoliths, Migrations, and Microservices
Monoliths, Migrations, and Microservices
 
Why Microservices
Why MicroservicesWhy Microservices
Why Microservices
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
APIs in a Microservice Architecture
APIs in a Microservice ArchitectureAPIs in a Microservice Architecture
APIs in a Microservice Architecture
 

Andere mochten auch

Andere mochten auch (20)

The Journey from Monolith to Microservices: a Guided Adventure
The Journey from Monolith to Microservices: a Guided AdventureThe Journey from Monolith to Microservices: a Guided Adventure
The Journey from Monolith to Microservices: a Guided Adventure
 
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
Lessons Learned from Migrating Legacy Enterprise Applications to MicroservicesLessons Learned from Migrating Legacy Enterprise Applications to Microservices
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
 
Serverless Microservices
Serverless MicroservicesServerless Microservices
Serverless Microservices
 
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInventPros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
 
Discussion About Microservices Architecture
Discussion About Microservices ArchitectureDiscussion About Microservices Architecture
Discussion About Microservices Architecture
 
GeoServer on Steroids at FOSS4G Europe 2014
GeoServer on Steroids at FOSS4G Europe 2014GeoServer on Steroids at FOSS4G Europe 2014
GeoServer on Steroids at FOSS4G Europe 2014
 
Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in Components
 
Online Spreadsheet for your Web Applications using Kendo UI
Online Spreadsheet for your Web Applications using Kendo UIOnline Spreadsheet for your Web Applications using Kendo UI
Online Spreadsheet for your Web Applications using Kendo UI
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Why would I store my data in more than one database?
Why would I store my data in more than one database?Why would I store my data in more than one database?
Why would I store my data in more than one database?
 
From Monolith to Microservices with Cassandra, Grpc, and Falcor (Luke Tillman...
From Monolith to Microservices with Cassandra, Grpc, and Falcor (Luke Tillman...From Monolith to Microservices with Cassandra, Grpc, and Falcor (Luke Tillman...
From Monolith to Microservices with Cassandra, Grpc, and Falcor (Luke Tillman...
 
Angular js o React? Spunti e idee per la scelta di un framework
Angular js o React? Spunti e idee per la scelta di un frameworkAngular js o React? Spunti e idee per la scelta di un framework
Angular js o React? Spunti e idee per la scelta di un framework
 
Part II - Summary of service oriented architecture (SOA) concepts, technology...
Part II - Summary of service oriented architecture (SOA) concepts, technology...Part II - Summary of service oriented architecture (SOA) concepts, technology...
Part II - Summary of service oriented architecture (SOA) concepts, technology...
 
Web development at Live: Frontend Software Intro + Trade-offs, React, Angular
Web development at Live: Frontend Software Intro + Trade-offs, React, AngularWeb development at Live: Frontend Software Intro + Trade-offs, React, Angular
Web development at Live: Frontend Software Intro + Trade-offs, React, Angular
 
How to Adopt Docker Within Your Enterprise Using IBM UrbanCode Deploy (Interc...
How to Adopt Docker Within Your Enterprise Using IBM UrbanCode Deploy (Interc...How to Adopt Docker Within Your Enterprise Using IBM UrbanCode Deploy (Interc...
How to Adopt Docker Within Your Enterprise Using IBM UrbanCode Deploy (Interc...
 
Why we need container in Software
Why we need container in SoftwareWhy we need container in Software
Why we need container in Software
 
From Docker To Kubernetes: A Developer's Guide To Containers - Mandy White - ...
From Docker To Kubernetes: A Developer's Guide To Containers - Mandy White - ...From Docker To Kubernetes: A Developer's Guide To Containers - Mandy White - ...
From Docker To Kubernetes: A Developer's Guide To Containers - Mandy White - ...
 
Springboot and camel
Springboot and camelSpringboot and camel
Springboot and camel
 
Service Oriented Architecture
Service Oriented ArchitectureService Oriented Architecture
Service Oriented Architecture
 
Back to the future: Isomorphic javascript applications
Back to the future:  Isomorphic javascript applicationsBack to the future:  Isomorphic javascript applications
Back to the future: Isomorphic javascript applications
 

Ähnlich wie Monoliths and Microservices

Software Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesSoftware Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based Architectures
Angelos Kapsimanis
 
Docker-N-Beyond
Docker-N-BeyondDocker-N-Beyond
Docker-N-Beyond
santosh007
 
Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?
Lohika_Odessa_TechTalks
 
Microservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud FoundryMicroservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud Foundry
Emilio Garcia
 

Ähnlich wie Monoliths and Microservices (20)

Microservice intro
Microservice introMicroservice intro
Microservice intro
 
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 Microservices for Mortals by Bert Ertman at Codemotion Dubai Microservices for Mortals by Bert Ertman at Codemotion Dubai
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 
Microservices for Mortals
Microservices for MortalsMicroservices for Mortals
Microservices for Mortals
 
Understanding Microservices
Understanding Microservices Understanding Microservices
Understanding Microservices
 
Should i break it?
Should i break it?Should i break it?
Should i break it?
 
Monolith to microservices?
Monolith to microservices?Monolith to microservices?
Monolith to microservices?
 
Microservices vs monolithics betabeers
Microservices vs monolithics   betabeersMicroservices vs monolithics   betabeers
Microservices vs monolithics betabeers
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best Practices
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Software Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based ArchitecturesSoftware Architectures, Week 3 - Microservice-based Architectures
Software Architectures, Week 3 - Microservice-based Architectures
 
Hacking the way you work
Hacking the way you workHacking the way you work
Hacking the way you work
 
DerbyDev_ModMonolith_290323.pptx
DerbyDev_ModMonolith_290323.pptxDerbyDev_ModMonolith_290323.pptx
DerbyDev_ModMonolith_290323.pptx
 
Microservices: The Right Way
Microservices: The Right WayMicroservices: The Right Way
Microservices: The Right Way
 
QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes QCon 2015 - Microservices Track Notes
QCon 2015 - Microservices Track Notes
 
Microfrontends Monoreops & Trunkbased based
Microfrontends Monoreops & Trunkbased basedMicrofrontends Monoreops & Trunkbased based
Microfrontends Monoreops & Trunkbased based
 
Docker-N-Beyond
Docker-N-BeyondDocker-N-Beyond
Docker-N-Beyond
 
From Monolithic to Microservices in 45 Minutes
From Monolithic to Microservices in 45 MinutesFrom Monolithic to Microservices in 45 Minutes
From Monolithic to Microservices in 45 Minutes
 
Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Microservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud FoundryMicroservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud Foundry
 

Mehr von Bozhidar Bozhanov

Mehr von Bozhidar Bozhanov (20)

Антикорупционен софтуер
Антикорупционен софтуерАнтикорупционен софтуер
Антикорупционен софтуер
 
Nothing is secure.pdf
Nothing is secure.pdfNothing is secure.pdf
Nothing is secure.pdf
 
Elasticsearch - Scalability and Multitenancy
Elasticsearch - Scalability and MultitenancyElasticsearch - Scalability and Multitenancy
Elasticsearch - Scalability and Multitenancy
 
Encryption in the enterprise
Encryption in the enterpriseEncryption in the enterprise
Encryption in the enterprise
 
Blockchain overview - types, use-cases, security and usabilty
Blockchain overview - types, use-cases, security and usabiltyBlockchain overview - types, use-cases, security and usabilty
Blockchain overview - types, use-cases, security and usabilty
 
Електронна държава
Електронна държаваЕлектронна държава
Електронна държава
 
Blockchain - what is it good for?
Blockchain - what is it good for?Blockchain - what is it good for?
Blockchain - what is it good for?
 
Algorithmic and technological transparency
Algorithmic and technological transparencyAlgorithmic and technological transparency
Algorithmic and technological transparency
 
Scaling horizontally on AWS
Scaling horizontally on AWSScaling horizontally on AWS
Scaling horizontally on AWS
 
Alternatives for copyright protection online
Alternatives for copyright protection onlineAlternatives for copyright protection online
Alternatives for copyright protection online
 
GDPR for developers
GDPR for developersGDPR for developers
GDPR for developers
 
Политики, основани на данни
Политики, основани на данниПолитики, основани на данни
Политики, основани на данни
 
Отворено законодателство
Отворено законодателствоОтворено законодателство
Отворено законодателство
 
Overview of Message Queues
Overview of Message QueuesOverview of Message Queues
Overview of Message Queues
 
Electronic governance steps in the right direction?
Electronic governance   steps in the right direction?Electronic governance   steps in the right direction?
Electronic governance steps in the right direction?
 
Сигурност на електронното управление
Сигурност на електронното управлениеСигурност на електронното управление
Сигурност на електронното управление
 
Opensource government
Opensource governmentOpensource government
Opensource government
 
Биометрична идентификация
Биометрична идентификацияБиометрична идентификация
Биометрична идентификация
 
Biometric identification
Biometric identificationBiometric identification
Biometric identification
 
Регулации и технологии
Регулации и технологииРегулации и технологии
Регулации и технологии
 

Kürzlich hochgeladen

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 Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
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
 

Kürzlich hochgeladen (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
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
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
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%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
 
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
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%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
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
%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
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
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
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%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
 

Monoliths and Microservices