Group 5: Messaging & Events
Primary purpose: asynchronous decoupling & event distribution. Members: Service Bus, Event Grid, Event Hubs, Queue Storage, SignalR Service.
Latent confusion: Event Grid = reactive routing of discrete events; Event Hubs = streaming ingest (high throughput); Service Bus = enterprise messaging semantics (queues/topics, sessions, transactions); Queue Storage = simple durable queue; SignalR = real-time push to connected clients.
Services & Core Identity
Service Bus
Enterprise messaging (queues + topics) with sessions, transactions, dead-lettering, ordering, duplicate detection.
- Use: business commands, workflow steps.
- Advanced semantics vs simple queue.
- At-least-once; supports FIFO via sessions.
Event Grid
Lightweight event routing (pub/sub) pushing to handlers (Functions, WebHooks). Low-latency fan-out.
- Use: reactive, discrete events
- Delivers to multiple subscribers
- Pull pattern not needed
Event Hubs
High-throughput, distributed log (Kafka-like). Partitioned consumer groups; replay from offsets.
- Use: telemetry, stream pipelines
- Retain window (hours-days)
- Pull/stream model
Queue Storage
Simple FIFO-ish (best effort) durable queue. Very low cost; no transactions/fan-out.
- Use: basic background work items
- Peeking, invisibility timeout
- No topics/fan-out
SignalR
Real-time push (WebSockets) to clients. Not a queue or durable store.
- Use: dashboards, live updates
- Transitory messages
- Scale-out via backplanes
Key Differences
Dimension | Service Bus | Event Grid | Event Hubs | Queue Storage | SignalR |
---|---|---|---|---|---|
Pattern | Messaging (commands) | Event routing | Streaming log | Simple queue | Realtime push |
Throughput | Med | Low/Med | Very High | Low/Med | Med |
Latency | Low | Very Low | Low | Low | Very Low |
Ordering | Yes (sessions) | No | Per partition | Best effort | N/A |
Transactions | Yes | No | No | No | No |
Fan-out native | Topics | Yes (subscriptions) | Consumer groups | No | Broadcast to clients |
Retention | Until dequeued | Short retry | Time window | Until dequeued | Transient |
Replay | No | No | Yes (offset) | No | No |
Cost Model | Ops + throughput units | Ops | Throughput units (TU/CU) | Storage + ops | Connections + messages |
Mathematical Selection Model
Criteria [0..10]. Scores reflect best primary service; reuse multiple if patterns differ.
Score_SBus = 0.30*C_enterprise + 0.20*C_order + 0.15*C_tx + 0.10*C_fanout + 0.15*C_cmd + 0.10*(10 - C_stream)
Score_EGrid = 0.30*C_fanout + 0.25*C_events + 0.15*C_latency + 0.10*(10 - C_order) + 0.10*(10 - C_stream) + 0.10*(10 - C_tx)
Score_EHubs = 0.35*C_stream + 0.20*C_throughput + 0.15*C_replay + 0.10*C_latency + 0.10*(10 - C_tx) + 0.10*(10 - C_order)
Score_QQueue = 0.30*C_simple + 0.20*C_cost + 0.15*C_background + 0.10*(10 - C_order) + 0.15*(10 - C_fanout) + 0.10*(10 - C_tx)
Score_SignalR = 0.35*C_realtime + 0.20*C_latency + 0.15*C_clients + 0.15*C_push + 0.10*(10 - C_replay) + 0.05*(10 - C_tx)
Service Bus {{vm.scores.sbus | number:2}}
Event Grid {{vm.scores.egrid | number:2}}
Event Hubs {{vm.scores.ehubs | number:2}}
Queue Storage {{vm.scores.queue | number:2}}
SignalR {{vm.scores.signalr | number:2}}
Recommended: {{vm.recommended.name}} ({{vm.recommended.score | number:2}})
Interpretation Rules
- If C_stream ≥ 7 → Event Hubs (maybe plus Event Grid downstream).
- If C_tx ≥ 6 OR C_order ≥ 6 → Service Bus.
- If C_fanout ≥ 6 AND C_latency ≥ 6 → Event Grid.
- If C_simple ≥ 6 AND C_cost ≥ 6 → Queue Storage.
- If C_realtime ≥ 7 → SignalR (combine with queue for reliability if needed).
When NOT to Use Messaging & Events
- Synchronous RPC only → direct HTTP/API Management.
- Batch file movement → Data Factory / Storage events.
- Massive analytics transform → Stream Analytics / Data Explorer.
Summary
Service Bus for enterprise messaging semantics. Event Grid for light push event fan-out. Event Hubs for high-throughput streaming and replay. Queue Storage for simple cost-effective background tasks. SignalR for realtime client updates. Combine patterns consciously (e.g., Event Hubs + Functions + Storage).