One of the current features that Microsoft has in preview in Azure is Event Grid. Events in Azure represent a new ability to design applications at massive scale that are based upon an event-driven model. There are several advantages to architecting applications in an event-driven pattern. In this blog series, I will drill into Microsoft’s Azure Event product offerings, examine some of the underlying concepts in architecture and programming behind them, talk about the advantages they provide, and show concrete examples of implementation.
To start first, let’s investigate why Azure Event Grid might be of interest to us, and what potential benefits it might bring to include into our architecture design.
Why? Underlying Concepts
Two key concepts surface when talking about Microsoft’s Azure product offerings in the event area are: event-driven programming and, closely related, event-driven architecture.
In computer programming, event-driven programming is a programming paradigm in which the flow of the program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or messages from other programs/threads. (from Wikipedia).
Event-driven architecture (EDA), also known as Message-driven architecture, is a software architecture pattern promoting the production, detection, consumption of, and reaction to events. An event can be defined as "a significant change in state." For example, when a consumer purchases a car, the car's state changes from "for sale" to "sold." (from Wikipedia)
In talking about these event-driven design concepts, these are patterns that have emerged in design of decoupled distributed systems, and the rise of microservices. This is a pattern evolution from request driven architecture, where increased numbers of disconnected systems have driven the need for greater decoupling. A push-based asynchronous design allows for greater elasticity and fault tolerance between connected microservices.
Some of the potential benefits to using an event-driven pattern include some of the following:
- Reduced Information Latency – with an asynchronous fire and subscribe pattern to events, this enables us to design solutions that represent more real time state of the business. This can drive more accuracy in responses.
- Scalability – with asynchronous event patterns there are less interdependencies between components as well as less process blocking between components
- Cost – many times synchronous connected systems require polling, which has an overhead
- Fault Tolerance – asynchronous patterns allow for better recovery
- Data Integration - with an event based approach the data and most up-to-date representation of business state is preserved
Microsoft Azure Event Grid
With some of the benefits in mind and an understanding of the basic concepts, let’s take a look at Microsoft’s Azure Event Grid, currently in preview in Azure:
Fig 1 – Azure Event Grid
As the figure above shows, there are several Event Publishers available in Azure. The big blue graphic in the middle is the Event Grid. Your Azure subscription itself can be a source, where changes in your subscription can publish an event that could be handled. A Resource Group in Azure also can be an Event Publisher source. Both of these events can be very interesting in the infrastructure and security space, to be able to detect changes and drive notifications. One interesting Event Handler in this scenario is Azure Automation, with the ability to trigger Runbooks from events.
Another interesting Event Publisher is Event Hubs. Microsoft Azure Event Hubs as a publisher can be utilized to ingress large amounts of data in to a process, and with the AMQP 1.0 messaging protocol it allows for minimal footprint devices (such as a Raspberry Pi) to route data to Azure. One of my series blog posts will delve into this aspect of the Event Grid.
A third compelling Event Publisher is Blob Storage. This pattern can allow for a microservice for example, to act upon an image file uploaded to blob storage, fire an event, route that through Event Grid to a Logic App or Azure Function. One of my blog posts will cover this Event Grid pattern.
And lastly custom topics are a highly useful pattern allowing for the most flexibility in design.
In summary, Microsoft’s Azure Event Grid is a useful product offering in Azure to help implement an event-driven architecture or an event-driven programming model in the cloud.
Next, we will discuss Microsoft Azure serverless offerings, and how they integrate with Event Grid. Microsoft Azure Event Grid (Part 2), Microsoft Azure Event Grid (Part 3).