Service Bus
Definition
Azure messaging service that enables reliable communication between distributed applications, ensuring seamless data exchange and integration.
Use Cases
- Microsoft: Decoupling microservices and backend systems for reliable, asynchronous processing in Azure-based applications — Uses Azure Service Bus queues and topics/subscriptions to buffer work between services, apply retry policies, and route messages to different subscribers; leverages dead-letter queues to isolate poison messages for later inspection (Improved resilience and scalability by smoothing traffic spikes, reducing tight coupling between services, and enabling independent deployments of producers and consumers)
- Stack Overflow: Background job processing and asynchronous workflows to keep the website responsive under load — Uses Azure Service Bus messaging patterns to offload work from request/response paths into background processing, allowing workers to process tasks asynchronously and reliably (Better user-facing performance and more reliable processing of background tasks by separating interactive traffic from asynchronous workloads)
Provider Equivalents
- AWS: Amazon Simple Queue Service (SQS) and Amazon Simple Notification Service (SNS)
- Azure: Azure Service Bus
- GCP: Google Cloud Pub/Sub
- OCI: OCI Queue
Frequently Asked Questions
- What's the difference between Azure Service Bus and Azure Event Hubs?
- Service Bus is a message broker for application-to-application communication (commands, workflows, and business events) with features like queues, topics/subscriptions, dead-lettering, sessions, and transactions. Event Hubs is optimized for high-throughput event ingestion and streaming (telemetry, logs, IoT) where you process large volumes of events, often with stream processing tools. Use Service Bus for reliable workflow messaging; use Event Hubs for streaming pipelines.
- When should I use Azure Service Bus?
- Use Service Bus when you need reliable asynchronous communication between components, especially when producers and consumers scale independently. Common cases include order processing, payment workflows, inventory updates, request buffering during traffic spikes, fan-out notifications using topics/subscriptions, and integrating systems that must handle retries and dead-lettering for failed messages.
- How much does Azure Service Bus cost?
- Pricing depends mainly on the tier (Basic, Standard, Premium), usage, and features. Standard is typically priced by operations (message sends/receives and management operations) and supports topics/subscriptions and advanced broker features. Premium uses dedicated resources and is priced by capacity (messaging units) rather than per-operation, which can be more predictable for high throughput and low latency needs. Costs also vary with message size, number of connections, and features like sessions or transactions.
Category: communication
Difficulty: intermediate
Related Terms
See Also