Table of Contents

This article explains the differences and similarities between the two types of queues offered by Microsoft Azure, Azure Storage Queues and Service Bus Queues.

Introduction

Azure storage Queues are a part of the Azure storage infrastructure feature, a simple REST-based Get/Put/Peek interface, offering persistent, reliable messaging within and between services.

Azure Storage infrastructure

Azure Storage delivers the flexibility to store and retrieve large amounts of data, such as documents and media files by Azure Blobs structured no SQL based data by Azure Tables; reliable messages by Azure Queues, and use MB based Azure Files for migrating on-premises applications to the cloud.

Azure Service Bus queues are part of Azure messaging infrastructure that supports queuing as well as to publish/subscribe Web service remoting, and integration patterns.

Azure messaging infrastructure

Azure Service Bus is cloud-based messaging system for connecting applications, services and devices, no matter where these components exist. We can use a service bus to connect apps running on Azure with on-premises. It can also connect household appliances, like sensors and other devices like tablets or phones to a central application or to each other.

The Azure messaging infrastructure provides four separate communication mechanisms, Queues, Topics, Relays and Event Hubs.
.
Where to use Azure Queues, a scenario

Azure Queues

The main reason for using queues is to provide loose connectivity among various components. For example, we have two components of an application to exchange data. Here one of them is on-premise and one exists in the cloud. Here if we use a web service to exchange data we have the following issues:

In Azure Queues you have a queue as mediator that connects the two components, so when the receiver is down, the sender can still insert messages into the queue, once a receiver comes online it can receive message from that queue. And for scale up we just need to add more receivers and your queue is processed in parallel.

The following are the drawbacks of using a queue:

Azure Storage Queues

Azure Queue Storage can store multile messages that we can access via HTTP or HTTPS. It offers a highly reliable and very cheap queuing service to us. A queue’s message size is allowed to be up to 64 KB in size, and when dequeueing a message, it should not be visible to other receivers. A queue can contain millions of messages, depending on the capacity of a storage account.

Sample Account

The following are common uses of Azure storage Queue:

To understand the preceding uses in details refer to link:

Azure Service Bus queues

Microsoft Azure Service Bus provides two messaging solutions, one is relay and the other messaging solution is brokered messaging.

Brokered messaging provides asynchronous communication, where senders and receivers do not need to be online at the same time. The messaging infrastructure reliably stores messages in a broker (queue) until the receiving party is ready to receive them, and the sender does not need to wait for a reply from the receiver in order to continue its processing and send further messages. That way components of the distributed application can be disconnected.

Service bus queues have the following properties:

The following are common uses of Queue storage:

Differences between Storage Queue and Service Bus Queue

Cost-based Difference

Performance based Difference

Capacity and quotas based

Security

For authentication, storage queues use security tokens that are shared by other storage components like tables and BLOBs. For accessing an Azure queue you need to provide the storage account name and the token associated with it.

An Azure Access Control Service (ACS) is used as the primary authentication mechanism for service bus queues, but it also supports multiple predefined identity providers as well as custom ones.

ACS is an Azure service that provides a simple way to authenticate users to access your web applications and services without having to add complex authentication logic to your code.

Other Differences

DIFFERENCE CRITERIA STORAGE QUEUES SERVICE BUS QUEUES
Delivery guarantee At-Least-Once At-Least-Once
At-Most-Once
Can send in Batch No Yes
Ordering No Yes - First-In-First-Out
Transaction support No Yes
Lease or Lock duration 30 seconds (default) 60 seconds (default)
Can log server-side transaction Yes No
Can received in batch Explicitly supported, but max 32 messages Implicitly support it
Message groups No Can be done by using messaging sessions
Support for Duplicate detection No Can be done on sender side
WCF integration allowed No Yes
Fetching message sessions by ID No Yes
Message auto-forwarding

By Auto-forwarding you can chain a queue or subscription to another queue or topic in the same service namespace. When its state is on, Service Bus automatically removes messages that are located in the first queue or places them in the second queue.

For more details refer link:
No Yes
Dead lettering No Yes
Dead lettering queues are used for storing messages that could not be delivered. These are generated automatically by system. There are two types of dead-letter queues, that are transactional and a non-transactional.

Refer the following link to be familiar with
Dead-Letter Queues.
No Yes

When to Use What

Use Azure Storage Service Queues when:

The following are the Best Practices for Azure storage Queues:

Best Practices for Azure service bus Queue: