SlideShare a Scribd company logo
1 of 18
Azure Event Grid
Vs.
Azure Service Hub
Sandun Perera
Software Architect @ Geveo Australasia
2024/01/31
The context
• Azure messaging platforms
• Commonly used in microservices designs
and as an inter-system communication
backbone.
• Need to evaluate based on system
requirements to decide which one to use.
What is your messaging
platform?
• Azure Event Grid
• Azure Service Bus
• Azure Notification Hub
• WSO2 Enterprise Service
Bus
• Apache Kafka
• Other?
Azure Event Grid
• Uses publish-subscribe model.
• Enables event-based message passing.
• Comfortable with reactive programming.
• Publisher emits messages and forget.
• Subscriber will decide which events to handle.
• Deeply integrated with Azure services for easy integration
with third-party services.
• Event consumption is simplified by avoiding polling.
• Effective and efficient event routing.
• Event Grid is a global resource, hence no regional barriers.
• Can push messages to larger number of subscribers by
design.
Azure Service Bus
• Works as push-pull model.
• More targeted for transactional messaging.
• Service bus is a regional resource and limited to the
region.
• Limited number of connections for polling.
Push Vs. Pull
Event Grid uses a Push mechanism to proactively send events to Subscribers, while Service Bus
employs a Pull mechanism where subscribers retrieve messages. The risk of overwhelming
Subscribers with Event Grid's push approach can lead to throttling or unresponsiveness. To
address this, a test was conducted by a team, with a Logic App as a Subscriber, revealing failures
in processing due to the rapid delivery of 200 messages in 50 seconds. Introducing a Service Bus
between Event Grid and the Logic App, allowing the Logic App to work at its own pace, proved
essential for resolving the issue.
In contrast, Service Bus's Pull mechanism allows Subscribers to fetch messages at their desired
rate, preventing exceptions even with a high volume of events. The revised architecture included a
Service Bus between Event Grid and its Subscriber, with the Logic App broken into individual
functions for better control. Testing with JMeter demonstrated successful processing of 200
messages in 7-8 minutes and scaling up to 1000 messages in 13-14 minutes, highlighting the
enhanced resilience and fault tolerance achieved by integrating Service Bus.
Loss of messages
Service Bus requires explicit deletion of messages from the subscription queue under peek and
lock mode, ensuring that Subscribers control when messages are removed. In contrast, Event Grid
immediately deletes messages from the Event Grid Topic upon delivery to the Subscriber. In above
experiments, the team observed that in Event Grid, if exceptions occurred during event processing
and were not appropriately handled by the Subscriber, such as forwarding the message to a dead
letter queue, the messages could be lost.
Conversely, in the case of Service Bus, when exceptions occur during message processing, the
message is automatically moved to the Dead Letter queue, allowing for automatic retries. Unlike
Event Grid, Service Bus Subscribers do not need to explicitly send messages to the dead letter
queue; the system automatically routes messages to the Dead-Letter queue in the event of
exceptions.
Order of delivery
Event Grid does not provide a guarantee regarding the order of event delivery,
while in the case of Service Bus, the utilization of Message sessions allows us to
obtain ordered messages.
Duplicate detection
Event Grid lacks support for transaction and duplicate detection, while it is a
feature that is available in Service Bus.
Viewer
While the application is in production or development, it is crucial to monitor the messages
published in the Azure Messaging Service. Microsoft has not introduced any default product for
viewing Event Grid messages. However, external applications like EventGridViewer can be
integrated as subscribers to the events. It's important to note that EventGridViewer doesn't store
events, so if retrospective event analysis is needed, another subscriber must be added to store the
data in a datastore. Additionally, a mechanism for filtering and viewing stored events should be
implemented. It's worth mentioning that this subscriber may face throttling if messages are posted
to it at a higher rate.
In contrast, Microsoft has released a tool named Service Bus Explorer, specifically designed for
inspecting published messages. For details, please refer to the version of Service Bus Explorer
available in the Azure Portal.
Message retention and lost policy
• Both EventGrid and ServiceBus are resilient in trying to deliver the message to their Subscribers.
• The EventGrid will drop the event if either of the limits of the retry policy is reached.
Maximum number of attempts - Between 1 and 30. The default value is 30.
Event time-to-live (TTL) - The value must be between 1 and 1440. The default value is 1440
mins.
• EventGrid drops the event to the Dead-letter queue if configured, otherwise, the event is permanently
lost. Also, if the dead letter container is not online for 4 hours, then the event will be lost.
• In the case of Azure Service Bus, the messages are pushed to the subscriber queues. While creating a
Subscriber one can configure how long the message will remain in the Subscription queue before
being removed. One can even set a setting that may even allow a message to remain in the
subscription queue for a very long time.
Dead letter queue
• Both Service Bus and Event Grid support the Dead-letter queues. The only difference is that in Service
Bus Dead-letter queue is available by default whereas in Event Grid it needs to be configured using a
Storage account.
Integration with azure resources
Many azure
resources have
default integration
with Event Grid.
When to use what
In the context of Microservice architecture, where microservices exchange valuable messages,
opting for Service Bus over Event Grid is advisable for the following reasons:
1. Service Bus permits subscribers to consume messages at their own pace, unlike Event Grid, which
pushes events to subscribers, leading to potential exceptions when the event push rate exceeds the
Subscriber's processing speed. This feature of Service Bus reduces errors in the system, enhancing
resilience and ease of maintenance.
2. Service Bus enables messages to be read in Peek and Lock mode, safeguarding them from being lost in
case of exceptions. Conversely, with Event Grid, there is a risk of events being lost.
3. Service Bus allows messages to be read in an organized manner, while Event Grid delivers messages in
an arbitrary order.
4. Service Bus supports Transaction and Duplication detection, a feature not available in Event Grid.
5. Service Bus offers superior tools like Service Bus Explorer for monitoring and maintenance, whereas
Event Grid lacks comparable out-of-the-box tools. This makes it more convenient to observe, manage,
and troubleshoot potential issues with Service Bus in the future.
Formal reviews
• Event Grid is easy to use and administer.
• Service Bus is easier to deal with business in overall.
• Reviewers think Event Grid meets the needs of business better than Service
Bus.
Reference
• https://www.linkedin.com/pulse/azure-event-grid-vs-service-bus-eklavya-gupta/
QUESTIONS?
THANK YOU!

More Related Content

Similar to Azure EventGrid vs Azure ServiceBus.pptx

Introduction to Azure Service Bus Presentation
Introduction to Azure Service Bus PresentationIntroduction to Azure Service Bus Presentation
Introduction to Azure Service Bus PresentationKnoldus Inc.
 
Introduction to Azure Event Grid
Introduction to Azure Event GridIntroduction to Azure Event Grid
Introduction to Azure Event GridCallon Campbell
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Patternjeetendra mandal
 
1. Overview of Distributed Systems
1. Overview of Distributed Systems1. Overview of Distributed Systems
1. Overview of Distributed SystemsDaminda Herath
 
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ ClustersIBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ ClustersDavid Ware
 
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
 
Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns
Beyond REST and RPC: Asynchronous Eventing and Messaging PatternsBeyond REST and RPC: Asynchronous Eventing and Messaging Patterns
Beyond REST and RPC: Asynchronous Eventing and Messaging PatternsClemens Vasters
 
Introduction to Event Driven Architecture
Introduction to Event Driven ArchitectureIntroduction to Event Driven Architecture
Introduction to Event Driven ArchitectureCitiusTech
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureFaren faren
 
Associated IoT Technologies.pptx
Associated IoT Technologies.pptxAssociated IoT Technologies.pptx
Associated IoT Technologies.pptxtaruian
 
MQTT Protocol: IOT Technology
MQTT Protocol: IOT TechnologyMQTT Protocol: IOT Technology
MQTT Protocol: IOT TechnologyShashank Kapoor
 
Cloud Native & Service Mesh
Cloud Native & Service MeshCloud Native & Service Mesh
Cloud Native & Service MeshRoi Ezra
 
Flaw less coding and authentication of user data using multiple clouds
Flaw less coding and authentication of user data using multiple cloudsFlaw less coding and authentication of user data using multiple clouds
Flaw less coding and authentication of user data using multiple cloudsIRJET Journal
 
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
 

Similar to Azure EventGrid vs Azure ServiceBus.pptx (20)

Micro Services
Micro ServicesMicro Services
Micro Services
 
Introduction to Azure Service Bus Presentation
Introduction to Azure Service Bus PresentationIntroduction to Azure Service Bus Presentation
Introduction to Azure Service Bus Presentation
 
Introduction to Azure Event Grid
Introduction to Azure Event GridIntroduction to Azure Event Grid
Introduction to Azure Event Grid
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Pattern
 
1. Overview of Distributed Systems
1. Overview of Distributed Systems1. Overview of Distributed Systems
1. Overview of Distributed Systems
 
Microservices
MicroservicesMicroservices
Microservices
 
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ ClustersIBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
 
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
 
Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns
Beyond REST and RPC: Asynchronous Eventing and Messaging PatternsBeyond REST and RPC: Asynchronous Eventing and Messaging Patterns
Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns
 
Introduction to Event Driven Architecture
Introduction to Event Driven ArchitectureIntroduction to Event Driven Architecture
Introduction to Event Driven Architecture
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Associated IoT Technologies.pptx
Associated IoT Technologies.pptxAssociated IoT Technologies.pptx
Associated IoT Technologies.pptx
 
MQTT Protocol: IOT Technology
MQTT Protocol: IOT TechnologyMQTT Protocol: IOT Technology
MQTT Protocol: IOT Technology
 
Microservices-101
Microservices-101Microservices-101
Microservices-101
 
Cloud Native & Service Mesh
Cloud Native & Service MeshCloud Native & Service Mesh
Cloud Native & Service Mesh
 
Flaw less coding and authentication of user data using multiple clouds
Flaw less coding and authentication of user data using multiple cloudsFlaw less coding and authentication of user data using multiple clouds
Flaw less coding and authentication of user data using multiple clouds
 
Analytics and etl based bi solutions
Analytics and etl based bi solutionsAnalytics and etl based bi solutions
Analytics and etl based bi solutions
 
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...
 
Ogsi standards
Ogsi standardsOgsi standards
Ogsi standards
 

More from Sandun Perera

Bootstrap 5 whats new
Bootstrap 5   whats newBootstrap 5   whats new
Bootstrap 5 whats newSandun Perera
 
Angular Form Validations
Angular Form ValidationsAngular Form Validations
Angular Form ValidationsSandun Perera
 
Introduction to NuoDB
Introduction to NuoDBIntroduction to NuoDB
Introduction to NuoDBSandun Perera
 
Microsoft Dynamics CRM 2013 Customization
Microsoft Dynamics CRM 2013 CustomizationMicrosoft Dynamics CRM 2013 Customization
Microsoft Dynamics CRM 2013 CustomizationSandun Perera
 
Tale of the photo camera
Tale of the photo cameraTale of the photo camera
Tale of the photo cameraSandun Perera
 
Visual Studio Unleashed - Tips and Tricks
Visual Studio Unleashed - Tips and TricksVisual Studio Unleashed - Tips and Tricks
Visual Studio Unleashed - Tips and TricksSandun Perera
 
What’s new in Visual Studio 2010
What’s new in Visual Studio 2010What’s new in Visual Studio 2010
What’s new in Visual Studio 2010Sandun Perera
 

More from Sandun Perera (12)

iUpgradable
iUpgradableiUpgradable
iUpgradable
 
Bootstrap 5 whats new
Bootstrap 5   whats newBootstrap 5   whats new
Bootstrap 5 whats new
 
Blazor
BlazorBlazor
Blazor
 
Angular Form Validations
Angular Form ValidationsAngular Form Validations
Angular Form Validations
 
Introduction to NuoDB
Introduction to NuoDBIntroduction to NuoDB
Introduction to NuoDB
 
Microsoft Dynamics CRM 2013 Customization
Microsoft Dynamics CRM 2013 CustomizationMicrosoft Dynamics CRM 2013 Customization
Microsoft Dynamics CRM 2013 Customization
 
SQL Windowing
SQL WindowingSQL Windowing
SQL Windowing
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
 
Car care
Car careCar care
Car care
 
Tale of the photo camera
Tale of the photo cameraTale of the photo camera
Tale of the photo camera
 
Visual Studio Unleashed - Tips and Tricks
Visual Studio Unleashed - Tips and TricksVisual Studio Unleashed - Tips and Tricks
Visual Studio Unleashed - Tips and Tricks
 
What’s new in Visual Studio 2010
What’s new in Visual Studio 2010What’s new in Visual Studio 2010
What’s new in Visual Studio 2010
 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
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 GoalsJhone kinadey
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
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
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

Azure EventGrid vs Azure ServiceBus.pptx

  • 1. Azure Event Grid Vs. Azure Service Hub Sandun Perera Software Architect @ Geveo Australasia 2024/01/31
  • 2. The context • Azure messaging platforms • Commonly used in microservices designs and as an inter-system communication backbone. • Need to evaluate based on system requirements to decide which one to use.
  • 3. What is your messaging platform? • Azure Event Grid • Azure Service Bus • Azure Notification Hub • WSO2 Enterprise Service Bus • Apache Kafka • Other?
  • 4. Azure Event Grid • Uses publish-subscribe model. • Enables event-based message passing. • Comfortable with reactive programming. • Publisher emits messages and forget. • Subscriber will decide which events to handle. • Deeply integrated with Azure services for easy integration with third-party services. • Event consumption is simplified by avoiding polling. • Effective and efficient event routing. • Event Grid is a global resource, hence no regional barriers. • Can push messages to larger number of subscribers by design.
  • 5. Azure Service Bus • Works as push-pull model. • More targeted for transactional messaging. • Service bus is a regional resource and limited to the region. • Limited number of connections for polling.
  • 6. Push Vs. Pull Event Grid uses a Push mechanism to proactively send events to Subscribers, while Service Bus employs a Pull mechanism where subscribers retrieve messages. The risk of overwhelming Subscribers with Event Grid's push approach can lead to throttling or unresponsiveness. To address this, a test was conducted by a team, with a Logic App as a Subscriber, revealing failures in processing due to the rapid delivery of 200 messages in 50 seconds. Introducing a Service Bus between Event Grid and the Logic App, allowing the Logic App to work at its own pace, proved essential for resolving the issue. In contrast, Service Bus's Pull mechanism allows Subscribers to fetch messages at their desired rate, preventing exceptions even with a high volume of events. The revised architecture included a Service Bus between Event Grid and its Subscriber, with the Logic App broken into individual functions for better control. Testing with JMeter demonstrated successful processing of 200 messages in 7-8 minutes and scaling up to 1000 messages in 13-14 minutes, highlighting the enhanced resilience and fault tolerance achieved by integrating Service Bus.
  • 7. Loss of messages Service Bus requires explicit deletion of messages from the subscription queue under peek and lock mode, ensuring that Subscribers control when messages are removed. In contrast, Event Grid immediately deletes messages from the Event Grid Topic upon delivery to the Subscriber. In above experiments, the team observed that in Event Grid, if exceptions occurred during event processing and were not appropriately handled by the Subscriber, such as forwarding the message to a dead letter queue, the messages could be lost. Conversely, in the case of Service Bus, when exceptions occur during message processing, the message is automatically moved to the Dead Letter queue, allowing for automatic retries. Unlike Event Grid, Service Bus Subscribers do not need to explicitly send messages to the dead letter queue; the system automatically routes messages to the Dead-Letter queue in the event of exceptions.
  • 8. Order of delivery Event Grid does not provide a guarantee regarding the order of event delivery, while in the case of Service Bus, the utilization of Message sessions allows us to obtain ordered messages.
  • 9. Duplicate detection Event Grid lacks support for transaction and duplicate detection, while it is a feature that is available in Service Bus.
  • 10. Viewer While the application is in production or development, it is crucial to monitor the messages published in the Azure Messaging Service. Microsoft has not introduced any default product for viewing Event Grid messages. However, external applications like EventGridViewer can be integrated as subscribers to the events. It's important to note that EventGridViewer doesn't store events, so if retrospective event analysis is needed, another subscriber must be added to store the data in a datastore. Additionally, a mechanism for filtering and viewing stored events should be implemented. It's worth mentioning that this subscriber may face throttling if messages are posted to it at a higher rate. In contrast, Microsoft has released a tool named Service Bus Explorer, specifically designed for inspecting published messages. For details, please refer to the version of Service Bus Explorer available in the Azure Portal.
  • 11. Message retention and lost policy • Both EventGrid and ServiceBus are resilient in trying to deliver the message to their Subscribers. • The EventGrid will drop the event if either of the limits of the retry policy is reached. Maximum number of attempts - Between 1 and 30. The default value is 30. Event time-to-live (TTL) - The value must be between 1 and 1440. The default value is 1440 mins. • EventGrid drops the event to the Dead-letter queue if configured, otherwise, the event is permanently lost. Also, if the dead letter container is not online for 4 hours, then the event will be lost. • In the case of Azure Service Bus, the messages are pushed to the subscriber queues. While creating a Subscriber one can configure how long the message will remain in the Subscription queue before being removed. One can even set a setting that may even allow a message to remain in the subscription queue for a very long time.
  • 12. Dead letter queue • Both Service Bus and Event Grid support the Dead-letter queues. The only difference is that in Service Bus Dead-letter queue is available by default whereas in Event Grid it needs to be configured using a Storage account.
  • 13. Integration with azure resources Many azure resources have default integration with Event Grid.
  • 14. When to use what In the context of Microservice architecture, where microservices exchange valuable messages, opting for Service Bus over Event Grid is advisable for the following reasons: 1. Service Bus permits subscribers to consume messages at their own pace, unlike Event Grid, which pushes events to subscribers, leading to potential exceptions when the event push rate exceeds the Subscriber's processing speed. This feature of Service Bus reduces errors in the system, enhancing resilience and ease of maintenance. 2. Service Bus enables messages to be read in Peek and Lock mode, safeguarding them from being lost in case of exceptions. Conversely, with Event Grid, there is a risk of events being lost. 3. Service Bus allows messages to be read in an organized manner, while Event Grid delivers messages in an arbitrary order. 4. Service Bus supports Transaction and Duplication detection, a feature not available in Event Grid. 5. Service Bus offers superior tools like Service Bus Explorer for monitoring and maintenance, whereas Event Grid lacks comparable out-of-the-box tools. This makes it more convenient to observe, manage, and troubleshoot potential issues with Service Bus in the future.
  • 15. Formal reviews • Event Grid is easy to use and administer. • Service Bus is easier to deal with business in overall. • Reviewers think Event Grid meets the needs of business better than Service Bus.