Insight

Event-driven patterns on Azure

When to use Service Bus, Event Grid, or Event Hubs—and how to avoid over-engineering your messaging layer.

Choosing the right tool

Azure offers three main options for messaging and events: Service Bus (queues and topics), Event Grid (pub/sub, event routing), and Event Hubs (high-throughput streaming). The choice depends on throughput, ordering guarantees, and how tightly coupled you want producers and consumers to be.

Practical guidance

  • Use Service Bus when you need reliable delivery, FIFO per queue, or transactional patterns. Good for order processing, workflow orchestration.
  • Use Event Grid when you need fan-out, low latency, and event-sourced or reactive integrations. Good for notifying multiple subscribers, reacting to blob uploads or resource changes.
  • Use Event Hubs when you're ingesting high-volume telemetry or streams. Overkill for most business events.

Common pitfalls

  • Don't default to Event Hubs for simple pub/sub—Event Grid is simpler and cheaper.
  • Avoid building a custom abstraction over all three; pick one or two per bounded context and stick with it.
  • Consider at-least-once vs exactly-once semantics early; it affects your entire consumer design.