SlideShare a Scribd company logo
1 of 18
Download to read offline
Grigoriadis Grigoris
Co-Founder & Software Architect @
Microservices enthusiast !
Introduction
Event-Based Microservices
What we will cover
● What is Monolithic Architecture
● What is Microservices Architecture
● Pros/Cons
● Moving to Event Based Microservices
Monolithic Architecture
DB
UI Module
Function calls
Server
● Building block is the code modules
● Modules communicate with each other using
function calls
● System is deployed and run as a single OS
process
● A Database is used in order to store the system
state, usually a relational database
Microservice Architecture - Bare Minimum
UI Microservice
HTTP calls
API Gateway
● Building block is the microservices
● Services communicate with each other via a
lightweight interoperable communication
protocol, usually HTTP
● Each service MUST have its own database
● An API Gateway provides a unified API for our
system
Q&A
Architectural Factors
Scalability Maintainability Evolvability Fault Tolerance
How well the system
handles a growing
amount of data/requests?
Is the system simple and
easy to understand?
Is the system design in such a
way that can evolve along with
the product requirements and
the changing ecosystem?
When part of the system fails
does it fail completely?
Horizontal
Scalability
Load Balancer
API Gateway API Gateway
Load Balancer
● The entire system must be scaled
● Different modules might have different
resource requirements
● Services can be deployed on
different machines
● Services can be scaled
independently
Monolithic
Microservices
● Databases must be scaled along with
microservices
● Service discovery
● Easier to scale
Maintainability
Monolithic
Microservices
● Easier to debug
● Each service is small in code size
and easier to understand
● Easier to work with different teams
● Boundaries between modules tend to
break
● Code size becomes intimidating
● A change can impact the whole system
● Communication between services might
become complicated and difficult to
follow
● Business logic might leak to API
Gateway and can become complex
API Gateway
Evolvability
Monolithic
Microservices
● Microservices can be rewritten individually in different language using different database
● Changes in infrastructure can be applied gradually to each microservice
● Refactoring in Database is easier since each database is governed by 1 team
● Any change, such language change, db change etc. must be applied to the whole
application
● Refactoring database requires coordination between multiple teams
t
t
Fault Tolerance
Monolithic
Microservices
● Part of the system will continue to work even if some services are not working
● If a module has a memory leak or malfunctions the whole system might stop working
Q&A
Microservice Architecture - Event Based
● An event is a fact, something that has already
happened and cannot change
● Every state change must generate an event
● Events should NOT be overly generic (e.g.
OrderUpdated), prefer more specific events like
OrderStatusChanged or even better
OrderDispatched etc.
● Events should contain only data relevant to the
event.
Event
+entityId: string
+time: DateTime
+type: string
Microservice Architecture - Event Based
UI Microservice
Through Broker
(Pub-Sub)
API Gateway
Broker
● Microservices publish events in the broker and
consume events that are of interest in order to
update their databases
● Services do not communicate with each other to
exchange information, they duplicate the data
they need from events
● System has Eventual Consistency
● Better performance
● Fault tolerant
● Service discovery only
used by API Gateway
● Difficult to design
● API Gateway is
still complex
Microservice Architecture - CQRS
UI
Command
Microservices
Through Broker
API Gateway
Broker
Query
Microservices
● Command microservices update the state of our
system and publish events
● Query microservices deal with keeping the data
in a schema appropriate for the UI
● Better performance
● Decoupled read from write
schema
● API Gateway does not
need to compose calls
● Still need to
commit to multiple
middleware
Microservice Architecture - Event Sourcing
UI
Through Event Store
API Gateway
Event Store
Command
Microservices
Query
Microservices
● All state changes in our system are represented
as events.
● All events are persisted in an event store.
● Each microservice creates its state from the
events in the event store and keeps a snapshot
for faster access.
● Better performance
● Each microservice can
recreate its state
● Difficult to implement
Q&A
Thank you!

More Related Content

What's hot

Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementInside Analysis
 
Micro frontends with react and redux dev day
Micro frontends with react and redux   dev dayMicro frontends with react and redux   dev day
Micro frontends with react and redux dev dayPrasanna Venkatesan
 
What's New In Entando 6 (And How It Helps Your Business)
What's New In Entando 6 (And How It Helps Your Business)What's New In Entando 6 (And How It Helps Your Business)
What's New In Entando 6 (And How It Helps Your Business)Entando
 
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)Binary Studio
 
Microservices with Spring Boot
Microservices with Spring BootMicroservices with Spring Boot
Microservices with Spring BootRasheed Waraich
 
WaveMaker Next: Webinar - Presentation
WaveMaker Next: Webinar  - PresentationWaveMaker Next: Webinar  - Presentation
WaveMaker Next: Webinar - PresentationSudeep Kumar
 
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)Tech Triveni
 
5 Key Steps To Implementing Micro Frontends On Kubernetes
5 Key Steps To Implementing Micro Frontends On Kubernetes5 Key Steps To Implementing Micro Frontends On Kubernetes
5 Key Steps To Implementing Micro Frontends On KubernetesEntando
 
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014Francisco Gonçalves
 
FEVR - Micro Frontend
FEVR - Micro FrontendFEVR - Micro Frontend
FEVR - Micro FrontendMiki Lombardi
 
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
[APIdays Paris 2019] From Microservices to APIs: The API operator in KubernetesWSO2
 
Introduction to Versioning (VCS) for Developers
Introduction to Versioning (VCS) for DevelopersIntroduction to Versioning (VCS) for Developers
Introduction to Versioning (VCS) for DevelopersAmpersand
 
Front end microservices: architectures and solution
Front end microservices: architectures and solutionFront end microservices: architectures and solution
Front end microservices: architectures and solutionMikhail Kuznetcov
 
Identity Server on Azure: A Reference Architecture
Identity Server on Azure: A Reference ArchitectureIdentity Server on Azure: A Reference Architecture
Identity Server on Azure: A Reference ArchitectureWSO2
 
The automation journey, feedback about the road to Ansible.
The automation journey, feedback about the road to Ansible.The automation journey, feedback about the road to Ansible.
The automation journey, feedback about the road to Ansible.🐺Guewen Faivre
 
API Gateway: Nginx way
API Gateway: Nginx wayAPI Gateway: Nginx way
API Gateway: Nginx wayinovia
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architectureTouraj Ebrahimi
 
Evolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand RaoEvolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand RaoVMware Tanzu
 
Api Gateway - What's the use of an api gateway?
Api Gateway - What's the use of an api gateway?Api Gateway - What's the use of an api gateway?
Api Gateway - What's the use of an api gateway?inovia
 

What's hot (20)

Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data Management
 
Micro frontends with react and redux dev day
Micro frontends with react and redux   dev dayMicro frontends with react and redux   dev day
Micro frontends with react and redux dev day
 
Microservice intro
Microservice introMicroservice intro
Microservice intro
 
What's New In Entando 6 (And How It Helps Your Business)
What's New In Entando 6 (And How It Helps Your Business)What's New In Entando 6 (And How It Helps Your Business)
What's New In Entando 6 (And How It Helps Your Business)
 
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
 
Microservices with Spring Boot
Microservices with Spring BootMicroservices with Spring Boot
Microservices with Spring Boot
 
WaveMaker Next: Webinar - Presentation
WaveMaker Next: Webinar  - PresentationWaveMaker Next: Webinar  - Presentation
WaveMaker Next: Webinar - Presentation
 
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)
 
5 Key Steps To Implementing Micro Frontends On Kubernetes
5 Key Steps To Implementing Micro Frontends On Kubernetes5 Key Steps To Implementing Micro Frontends On Kubernetes
5 Key Steps To Implementing Micro Frontends On Kubernetes
 
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014
 
FEVR - Micro Frontend
FEVR - Micro FrontendFEVR - Micro Frontend
FEVR - Micro Frontend
 
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
 
Introduction to Versioning (VCS) for Developers
Introduction to Versioning (VCS) for DevelopersIntroduction to Versioning (VCS) for Developers
Introduction to Versioning (VCS) for Developers
 
Front end microservices: architectures and solution
Front end microservices: architectures and solutionFront end microservices: architectures and solution
Front end microservices: architectures and solution
 
Identity Server on Azure: A Reference Architecture
Identity Server on Azure: A Reference ArchitectureIdentity Server on Azure: A Reference Architecture
Identity Server on Azure: A Reference Architecture
 
The automation journey, feedback about the road to Ansible.
The automation journey, feedback about the road to Ansible.The automation journey, feedback about the road to Ansible.
The automation journey, feedback about the road to Ansible.
 
API Gateway: Nginx way
API Gateway: Nginx wayAPI Gateway: Nginx way
API Gateway: Nginx way
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 
Evolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand RaoEvolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand Rao
 
Api Gateway - What's the use of an api gateway?
Api Gateway - What's the use of an api gateway?Api Gateway - What's the use of an api gateway?
Api Gateway - What's the use of an api gateway?
 

Similar to Introduction to event based microservices

Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices ArchitectureLucian Neghina
 
Ato Z of Microservices Architecture by Systango
Ato Z of Microservices Architecture by SystangoAto Z of Microservices Architecture by Systango
Ato Z of Microservices Architecture by SystangoSystango
 
Monolithic to Microservices Architecture - STM 6
Monolithic to Microservices Architecture - STM 6Monolithic to Microservices Architecture - STM 6
Monolithic to Microservices Architecture - STM 6Tricode (part of Dept)
 
Ledingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in actionLedingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in actionMukesh Singh
 
Introduction to Microservices.pdf
Introduction to Microservices.pdfIntroduction to Microservices.pdf
Introduction to Microservices.pdfShehanNIlanka
 
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...JSFestUA
 
Accion Labs microservices white paper
Accion Labs microservices white paper Accion Labs microservices white paper
Accion Labs microservices white paper Tony Kernan
 
Accion Labs Microservices Whitepaper
Accion Labs Microservices WhitepaperAccion Labs Microservices Whitepaper
Accion Labs Microservices WhitepaperTony Kernan
 
Accion labs microservices white paper
Accion labs microservices white paper Accion labs microservices white paper
Accion labs microservices white paper Tony Kernan
 
Microservices, docker , kubernetes and many more
Microservices, docker , kubernetes and many moreMicroservices, docker , kubernetes and many more
Microservices, docker , kubernetes and many moreVishwas N
 
Cpp In Soa
Cpp In SoaCpp In Soa
Cpp In SoaWSO2
 
[WSO2Con Asia 2018] Talk Microservices to Me: The Role of IAM in Microservice...
[WSO2Con Asia 2018] Talk Microservices to Me: The Role of IAM in Microservice...[WSO2Con Asia 2018] Talk Microservices to Me: The Role of IAM in Microservice...
[WSO2Con Asia 2018] Talk Microservices to Me: The Role of IAM in Microservice...WSO2
 
Introduction to Microservices Patterns
Introduction to Microservices PatternsIntroduction to Microservices Patterns
Introduction to Microservices PatternsDimosthenis Botsaris
 
Introduction to Microservices Patterns
Introduction to Microservices PatternsIntroduction to Microservices Patterns
Introduction to Microservices Patternsarconsis
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservicesRon Barabash
 
Service Fabric – building tomorrows applications today
Service Fabric – building tomorrows applications todayService Fabric – building tomorrows applications today
Service Fabric – building tomorrows applications todayBizTalk360
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 

Similar to Introduction to event based microservices (20)

Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Ato Z of Microservices Architecture by Systango
Ato Z of Microservices Architecture by SystangoAto Z of Microservices Architecture by Systango
Ato Z of Microservices Architecture by Systango
 
Monolithic to Microservices Architecture - STM 6
Monolithic to Microservices Architecture - STM 6Monolithic to Microservices Architecture - STM 6
Monolithic to Microservices Architecture - STM 6
 
Microservices
MicroservicesMicroservices
Microservices
 
Ledingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in actionLedingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in action
 
Introduction to Microservices.pdf
Introduction to Microservices.pdfIntroduction to Microservices.pdf
Introduction to Microservices.pdf
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
 
Accion Labs microservices white paper
Accion Labs microservices white paper Accion Labs microservices white paper
Accion Labs microservices white paper
 
Accion Labs Microservices Whitepaper
Accion Labs Microservices WhitepaperAccion Labs Microservices Whitepaper
Accion Labs Microservices Whitepaper
 
Accion labs microservices white paper
Accion labs microservices white paper Accion labs microservices white paper
Accion labs microservices white paper
 
Microservices, docker , kubernetes and many more
Microservices, docker , kubernetes and many moreMicroservices, docker , kubernetes and many more
Microservices, docker , kubernetes and many more
 
Microservice
MicroserviceMicroservice
Microservice
 
Cpp In Soa
Cpp In SoaCpp In Soa
Cpp In Soa
 
[WSO2Con Asia 2018] Talk Microservices to Me: The Role of IAM in Microservice...
[WSO2Con Asia 2018] Talk Microservices to Me: The Role of IAM in Microservice...[WSO2Con Asia 2018] Talk Microservices to Me: The Role of IAM in Microservice...
[WSO2Con Asia 2018] Talk Microservices to Me: The Role of IAM in Microservice...
 
Introduction to Microservices Patterns
Introduction to Microservices PatternsIntroduction to Microservices Patterns
Introduction to Microservices Patterns
 
Introduction to Microservices Patterns
Introduction to Microservices PatternsIntroduction to Microservices Patterns
Introduction to Microservices Patterns
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservices
 
Service Fabric – building tomorrows applications today
Service Fabric – building tomorrows applications todayService Fabric – building tomorrows applications today
Service Fabric – building tomorrows applications today
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 

Recently uploaded

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 

Recently uploaded (20)

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 

Introduction to event based microservices

  • 1.
  • 2. Grigoriadis Grigoris Co-Founder & Software Architect @ Microservices enthusiast !
  • 4. What we will cover ● What is Monolithic Architecture ● What is Microservices Architecture ● Pros/Cons ● Moving to Event Based Microservices
  • 5. Monolithic Architecture DB UI Module Function calls Server ● Building block is the code modules ● Modules communicate with each other using function calls ● System is deployed and run as a single OS process ● A Database is used in order to store the system state, usually a relational database
  • 6. Microservice Architecture - Bare Minimum UI Microservice HTTP calls API Gateway ● Building block is the microservices ● Services communicate with each other via a lightweight interoperable communication protocol, usually HTTP ● Each service MUST have its own database ● An API Gateway provides a unified API for our system
  • 7. Q&A
  • 8. Architectural Factors Scalability Maintainability Evolvability Fault Tolerance How well the system handles a growing amount of data/requests? Is the system simple and easy to understand? Is the system design in such a way that can evolve along with the product requirements and the changing ecosystem? When part of the system fails does it fail completely? Horizontal
  • 9. Scalability Load Balancer API Gateway API Gateway Load Balancer ● The entire system must be scaled ● Different modules might have different resource requirements ● Services can be deployed on different machines ● Services can be scaled independently Monolithic Microservices ● Databases must be scaled along with microservices ● Service discovery ● Easier to scale
  • 10. Maintainability Monolithic Microservices ● Easier to debug ● Each service is small in code size and easier to understand ● Easier to work with different teams ● Boundaries between modules tend to break ● Code size becomes intimidating ● A change can impact the whole system ● Communication between services might become complicated and difficult to follow ● Business logic might leak to API Gateway and can become complex API Gateway
  • 11. Evolvability Monolithic Microservices ● Microservices can be rewritten individually in different language using different database ● Changes in infrastructure can be applied gradually to each microservice ● Refactoring in Database is easier since each database is governed by 1 team ● Any change, such language change, db change etc. must be applied to the whole application ● Refactoring database requires coordination between multiple teams t t
  • 12. Fault Tolerance Monolithic Microservices ● Part of the system will continue to work even if some services are not working ● If a module has a memory leak or malfunctions the whole system might stop working
  • 13. Q&A
  • 14. Microservice Architecture - Event Based ● An event is a fact, something that has already happened and cannot change ● Every state change must generate an event ● Events should NOT be overly generic (e.g. OrderUpdated), prefer more specific events like OrderStatusChanged or even better OrderDispatched etc. ● Events should contain only data relevant to the event. Event +entityId: string +time: DateTime +type: string
  • 15. Microservice Architecture - Event Based UI Microservice Through Broker (Pub-Sub) API Gateway Broker ● Microservices publish events in the broker and consume events that are of interest in order to update their databases ● Services do not communicate with each other to exchange information, they duplicate the data they need from events ● System has Eventual Consistency ● Better performance ● Fault tolerant ● Service discovery only used by API Gateway ● Difficult to design ● API Gateway is still complex
  • 16. Microservice Architecture - CQRS UI Command Microservices Through Broker API Gateway Broker Query Microservices ● Command microservices update the state of our system and publish events ● Query microservices deal with keeping the data in a schema appropriate for the UI ● Better performance ● Decoupled read from write schema ● API Gateway does not need to compose calls ● Still need to commit to multiple middleware
  • 17. Microservice Architecture - Event Sourcing UI Through Event Store API Gateway Event Store Command Microservices Query Microservices ● All state changes in our system are represented as events. ● All events are persisted in an event store. ● Each microservice creates its state from the events in the event store and keeps a snapshot for faster access. ● Better performance ● Each microservice can recreate its state ● Difficult to implement