React in Real-Time with Azure Event Grid

Having only recently become generally available, Azure Event Grid is one of the newest members to join the existing suite of Azure messaging services. Azure Event Grid is a fully managed, event routing service, that provides a uniform approach to event consumption via a publish-subscribe model.

The graphic below is a summary of the current state of native integration. Note: Microsoft has stated that the intention is to roll this capability out much further, with Azure Data Lake Store, Cosmos DB and Data Factory already mentioned to be coming soon...

azure_event_grid.png

Benefits & Features

  • React to events in near real-time enabling event-driven programming scenarios.
  • Get started quickly with built-in support for a number of Azure services out of the box.
  • Ability to send custom events and support for third-party publishers via Custom Topics.
  • No longer need to perform scheduled or continuous polling (i.e. is it done yet? is it done yet? is it done yet?) with Event Grid pushing events as they occur.
  • Support for high throughput scenarios, Event Grid can scale to handle millions of events per second.
  • 24-hour retry with exponential backoff to ensure events are delivered.
  • The ability to fan-out (i.e. a single published event can be processed by multiple handlers).
  • Subscriptions can be configured with filters (e.g. Event Type, Published Path, etc) as a way of routing events that are relevant to subscribed handlers.

Concepts

  • Event Publisher: Where the event took place.
  • Event Handler: The application or service reacting to the event.
  • Topics: An endpoint where Event Publishers can send events.
  • Subscriptions: An endpoint where events are routed to be actioned by subscribed Event Handlers.
azure_event_grid_concepts.png

Demo

Scenario
1. Logic App is set to be triggered by Event Grid by subscribing to events from a Storage Account.
2. Storage Accounts fire an event whenever a Blob is Created or Deleted.
3. The subscription is configured to filter on a specific Event Type (Blob Created).
4. As the diagram illustrates, if a Blob is created then subsequently deleted, despite two events being sent and ingested by Event Grid, only a single event is ultimately delivered to the Logic App.

event_grid_demo.png

Pricing & Availability

Summary of the current state below, for up to date pricing and region availability refer to the relevant Microsoft documentation.

  • First 100,000 operations per month are free.
  • $0.60 USD per million operations.
  • Currently only available across regions within the US, Europe and Asia.

Azure Messaging Services

At the beginning of this post, I mentioned that Event Grid is just one of many services that Azure currently offers within the messaging domain (e.g. Service Bus, Event Hubs, IoT Hub, etc). This can make life challenging when tasked with choosing the right service for your solution. While there is some definite overlap and similarities between some of these products, each does have its own unique value proposition which is important to understand before making your decision. That said, comparing and contrasting the suite of Azure messaging services is another article in its own right so for now, I point you to some existing material that should help provide some clarity.