A Closer Look for Azure Functions, Azure Service Bus and Azure Event Hub — Considerations on Scaling Event-driven Architecture on Azure

Marcus Tee
12 min readFeb 3, 2022

Event driven architecture is common among large scale application, or cloud native application. In Azure context, Azure Event Hub and Azure Service Bus are the 2 most common Azure services to serve as messaging service and orchestrate messages to respective endpoint / micro-services.

Diagram below is a common snapshot on leveraging serverless approach to handle messages.

Depending on the use cases, the incoming messages are being processed in real time, for example, performing schema transformation, aggregation of array and more, as an initial processing. The cleansed data will then be ingested to another messaging bus for downstream processing. Let’s breakdown the component with respective Azure Services.

Event Producer

As the name suggest, it’s a component that emits event, or in this context, we can call it messages. When use click on a button, received a request, threshold/metrics are met, or timer, these are just few examples of event. The payload can be wrapped as a plain text, or object like JSON, especially when the message contains much information.

One thing to take note is the size per message. While there isn’t a good measure on the maximum / minimum size, it’s recommended to look at the protocol being used, and what is the maximum payload we can create per message. Advanced Message Queueing Protocol (AMQP) or HTTPS are commonly used as the protocol to connect event producer and messaging bus.

Depending on the use cases, event processor can become event producer too, for example, event processor A perform first level data transformation, and send the processed data to messaging bus again for further processing. In this case, the same event processor become event producer as well.

Besides custom-built application, some commonly used services in Azure such as Event Grid, Azure Stream Analytics, Azure Functions etc can also be used as event producer. Since these…

--

--