📜 ⬆️ ⬇️

Comparing Azure Queues and Service Bus Queues services

Microsoft Azure supports two types of queuing mechanisms: Azure Queues and Service Bus Queues .

Azure Queues , is part of the Azure storage infrastructure, providing a simple REST-oriented Get / Put / Peek interface for reliable, guaranteed delivery of messages within a service or between several services.

Service Bus Queues is part of the Azure messaging infrastructure, which deals with queuing, publishing / subscribing, web services and integration patterns (more about this Overview of Service Bus Messaging Patterns ).
')
Services run in parallel, Azure Queues appeared earlier as a separate queue mechanism built on top of Azure storage services.
Service Bus Queues are built on top of the “message broker” infrastructure, designed to connect applications or application components that may require support for various protocols, work in different domains or network environments.

This article compares these two queuing systems, focusing on differences in their behavior and implementation. The article also gives advice on choosing the type of queue, which is better suited to your application.


Considerations on the choice of technology


Both Azure Queues and Service Bus Queues are queue services on the Microsoft Azure platform. They have a slightly different set of features, so you can use one of them, or the other, or both together - depending on what your application needs. Below are recommendations for selection.

So, you should choose Azure Queues , if:


You should choose Service Bus Queues if:


Comparing Azure Queues and Service Bus Queues



The tables in the following sections are divided into logical groups, each of which compares Azure Queues and Service Bus Queues in some parameters.

Fundamental features


Comparison criterionAzure queuesService Bus Queues
Guaranteed to maintain orderNotYes - FIFO
(through the use of sessions)
Delivery guarantee"At least once""At least once"
“Maximum once”
Transaction supportNotYes
(through the use of local transactions)
Method of obtainingNot blockable
(ends immediately if there are no new messages)
Lockable with or without timeout
(see “ Comet technique ”)

Not blockable
(through the use of the .NET API)
Pushing messages by the server to the clientNotYes
OnMessage and OnMessage sessions .NET API
Method of obtainingPeek & LeasePeek & lock
Receive & Delete
Exclusive access to the messageBased on LeaseBased on lock
Lease / Lock timeout duration30 seconds (default)
7 days (maximum)
(can be updated or reset using the UpdateMessage API)
60 seconds (default)
(can be updated or reset using the RenewLock API)
Lease / Lock GranularityAt the message level
(each message can have its own timeout, for each message it can be changed using the UpdateMessage API)
At the queue level
(each queue has its own timeout, which applies to all messages in this queue, the timeout can be updated using the RenewLock API)
Batch receiptYes
(when receiving it is explicitly indicated how many messages are required, maximum - 32)
Yes
(implicitly through the inclusion of preloading or explicitly through transactions)
Batch shippingNotYes
(via transaction or batch sending on client side)


Additional Information



Additional features

Comparison criterionAzure queuesService Bus Queues
Scheduled DeliveryYesYes
Automatic labeling of "dead" messagesNotYes
Increase the lifetime of the message in the queueYes
(update timeout separately for each message in the queue)
Yes
(separate API function)
Support for not fully processed messagesYesYes
Post updateYesYes
Server side transaction logYesNot
Storage metricsYes
Minute metrics: real-time for availability, TPS, number of API calls, number of errors, etc., see About Storage Analytics Metrics
Yes
( GetQueues method)
State managementNotYes
Microsoft.ServiceBus.Messaging.EntityStatus.Active ,
Microsoft.ServiceBus.Messaging.EntityStatus.Disabled ,
Microsoft.ServiceBus.Messaging.EntityStatus.SendDisabled ,
Microsoft.ServiceBus.Messaging.EntityStatus.ReceiveDisabled
Auto message forwardingNotYes
Clearing the entire queueYesNot
Message groupsNotYes
(via session posts)
Application status for a group of messagesNotYes
Duplicate detectionNotYes
(configurable on the sender side)
WCF integrationNotYes
(WCF - binding provided)
Integration with WFExternal
(requires building your own WF activities)
Built
(provided by WF activities)
Message Viewer GroupsNotYes
Selection of messages of certain messages by session IDNotYes


Additional Information



Capacity and quotas


Comparison criterionAzure queuesService Bus Queues
Maximum queue size200 TB
(limited by total storage for one account)
From 1 GB to 80 GB (determined at the stage of creating a queue)
Maximum message size64 KB
(48 KB using Base64 encoding) Azure supports large messages by combining queues and blobs - so you can store up to 200 GB of data in a single message
256 KB (including header and message body, maximum header size is 64 KB)
Maximum message lifetime7 daysNot limited
Maximum number of queuesNot limited10,000
(per namespace, can be increased)
Maximum number of customersNot limitedNot limited
(100 connections for TCP clients)


Additional Information



Management and access


Comparison criterionAzure queuesService Bus Queues
Control protocolREST over HTTP / HTTPSREST over HTTPS
Transaction protocolREST over HTTP / HTTPSREST over HTTPS
AMQP 1.0 Standard (TCP with TLS)
.NET APIYes
(.NET Storage Client API)
Yes
(.NET API for message brokers)
Native c ++YesNot
Java APIYesYes
PHP APIYesYes
Node.js APIYesYes
Support for custom metadataYesNot
Queue Naming RulesUp to 63 characters
(letters must be lowercase)
Up to 260 characters
(queue names are case-insensitive)
Getting the number of messages in the queueYes
(approximate, excluding messages for which TTL has expired and they are in the process of being deleted)
Yes
(exact)
The function of viewing messages in the queue without their selectionYesYes


Additional Information



Performance

Comparison criterionAzure queuesService Bus Queues
Maximum throughputUp to 2000 messages per second
(for 1 KB messages)
Up to 2000 messages per second
(for 1 KB messages)
Average delay10 ms
(with TCP Nagle disabled)
20-25 ms
Overload behaviorHTTP code 503
(request is not paid)
HTTP code 503
(request is not paid)


Additional Information



Authentication and authorization


Comparison criterionAzure queuesService Bus Queues
AuthenticationBy symmetric keyBy symmetric key
Access control modelDelegated access to SAS tokensRBAC over ACS
Identity Provider ConsolidationNotYes


Additional Information



Prices


Comparison criterionAzure queuesService Bus Queues
Transaction cost$ 0.0005
(per 10,000 transactions)
$ 0.01
(per 10,000 posts)
Paid operationsEverythingOnly Send and Receive
(the rest are free)
Idle transactionsAre paid
(a request for a message with an empty queue costs as much as a request for messages)
Are paid
(request for a message from an empty queue is charged as receiving a single message)
Data storage cost$ 0.07
(per GB per month)
$ 0.00
Cost of external traffic$ 0.12 - $ 0.19
(depends on the data center)
$ 0.12 - $ 0.19
(depends on the data center)


Additional Information



Comment

Prices may vary. Look at the Pricing Overview page.

Conclusion



The decision to choose between Azure Queues and Service Bus Queues depends on many factors, the needs of your application and its architecture. If you’re already using other Azure services, such as tables or blobs, you’ll just start using Azure Queues, especially if you only need basic queue usage scenarios. On the other hand, Service Bus Queues offers a number of additional features, such as sessions, transactions, duplicate detection, automatic processing of “dead” messages, which may be necessary for your application.

Source: https://habr.com/ru/post/223863/


All Articles