Skip to main content

Service Bus Queues vs Windows Azure Queues

We saw until now how to work with Service Bus Queues, how we can handle some situations but why we should use Service Bus Queues and not Widows Azure Queue. Should we always use Service Bus Queues? If yes, why does Microsoft still have Windows Azure Queues. At these questions I will try to response in this blog post.
First of all let’s see some main difference between these two types of queues. The bathed mode is full only supported on Service Bus Queues using transactions. Windows Azure Queues support only for receiving messages and maximum 32 messages in a batch. In the same manner Service Bus Queues have support for "Receive ad Delete" mode, not only for "Peek and Lock" as Windows Azure Queues. "Peek and Lock" have a small downside. We need to make another request (another transaction) to remove the element from the queue - and this means additional costs. When we create a lock on a message for Windows Azure Queues the maxim duration can be 7 days in comparison with Service Bus Queues that accept as maxim value only 5 minutes. For Service Bus this configuration can be made on the queue level in comparison with Windows Azure Queues where the configuration can be made separate for each message from the queue. Any meta-data of a message can be changed in Windows Azure Queues. This is not supported on Service Bus Queues.

Service Bus Queues can guarantee that the order is the same (FIFO) and we don't receive messages in other order. On Windows Azure Queues the order can be corrupted when a lock on a messages expired and the message is available again. The concept of transactions can only be found on Service Bus Queues.
What is also missing from Windows Azure Queues is automatic dead lettering, WCF integration, duplicate detecting and the ability to group messaging (using session id). On the other side Service Bus Queues don't support in-place updates, purge content from a queue, built-in log support and storage metrics. From audit perspective I really miss the log support from Service Bus Queues. Both types of queues support schedule delivery, poison message support and message deferral.
From the perspective of supported protocols, in this moment Service Bus Queues have some limitation (don't support Node.js), but I expect this problem to be solved in the next update released. The performance of both types of queues is very similar - 2.000 messages per second can flow through a queue and the latency is small (10ms for Windows Azure Queues and 100s for Service Bus Queues). On the Servie Bus Queues the latency can create some problems if we want to consume a lot of messages in parallel, but we have some solutions here.
If we compare the size of a message that can be putted on a queue, Service Bus Queues lead with 256KB (and in the future will have 1MB or more). But the downside is the size of a queue that can have maximum 5GB (in this moment), where Windows Azure Queues don't have any limit. The same thing happens with the number of queues. For a given namespace we can have maximum 10.000 queues in a Service Bus, where Window Azure Queues don't have any limit. The TTL for a message can have a maximum value of 7 days for Windows Azure Queue where Service Buss Queues accept unlimited - I don't like this because in combination with the maximum size of a queue that is limited to 5GB we can have some problems.
What I enjoy on Service Bus Queues is the ways we can authenticate. Windows Azure Queues support only Symmetric key but Service Bus Queues supports ACS claims. Base on ACS claims we can have role-based access control and identify provider federation.
We can have different costs based on what type of queue we use. I will don't hang of numbers because this values can change What is important here is:
on Service Bus Queues we don't pay the storage cost
on Windows Azure Queues we pay the ACS token requests
This are the main differences between this two types of queues. I hope that I could highlight the main differences between this type of queues.
Until now we saw what are the main differences between these two types of queues. Both of them are queues, Microsoft cannot reinvent them but based on our needs we can use one or another.
In conclusion let’s see when we should use Service Bus Queues:
  • The queue is under 5GB
  • We want in the future to migrate to multi-subscribers (Service Bus Topics)
  • A message needs to be spited in more messages
  • A message can to be processed at-most-once
  • ACS claims and role-based authentication
  • WCF integration
  • TTL is more than 7 days
  • Duplicate detection for messages
  • FIFO order need to guaranteed
  • Transactions
And we should use Windows Azure Queues when:
  • We need log and audit over the queue
  • The total size of messages from the queue will exceed 5GB
  • We need to process a lot of messages in a short period of time
  • A message that is not full processes can be handling by other consumer very quick
We cannot say that Service Bus Queue is better than Windows Azure Queue. The best queue is the queue that is more suitable for our needs.

Comments

Popular posts from this blog

Windows Docker Containers can make WIN32 API calls, use COM and ASP.NET WebForms

After the last post , I received two interesting questions related to Docker and Windows. People were interested if we do Win32 API calls from a Docker container and if there is support for COM. WIN32 Support To test calls to WIN32 API, let’s try to populate SYSTEM_INFO class. [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOemId; public uint dwPageSize; public uint lpMinimumApplicationAddress; public uint lpMaximumApplicationAddress; public uint dwActiveProcessorMask; public uint dwNumberOfProcessors; public uint dwProcessorType; public uint dwAllocationGranularity; public uint dwProcessorLevel; public uint dwProcessorRevision; } ... [DllImport("kernel32")] static extern void GetSystemInfo(ref SYSTEM_INFO pSI); ... SYSTEM_INFO pSI = new SYSTEM_INFO(

Azure AD and AWS Cognito side-by-side

In the last few weeks, I was involved in multiple opportunities on Microsoft Azure and Amazon, where we had to analyse AWS Cognito, Azure AD and other solutions that are available on the market. I decided to consolidate in one post all features and differences that I identified for both of them that we should need to take into account. Take into account that Azure AD is an identity and access management services well integrated with Microsoft stack. In comparison, AWS Cognito is just a user sign-up, sign-in and access control and nothing more. The focus is not on the main features, is more on small things that can make a difference when you want to decide where we want to store and manage our users.  This information might be useful in the future when we need to decide where we want to keep and manage our users.  Feature Azure AD (B2C, B2C) AWS Cognito Access token lifetime Default 1h – the value is configurable 1h – cannot be modified

What to do when you hit the throughput limits of Azure Storage (Blobs)

In this post we will talk about how we can detect when we hit a throughput limit of Azure Storage and what we can do in that moment. Context If we take a look on Scalability Targets of Azure Storage ( https://azure.microsoft.com/en-us/documentation/articles/storage-scalability-targets/ ) we will observe that the limits are prety high. But, based on our business logic we can end up at this limits. If you create a system that is hitted by a high number of device, you can hit easily the total number of requests rate that can be done on a Storage Account. This limits on Azure is 20.000 IOPS (entities or messages per second) where (and this is very important) the size of the request is 1KB. Normally, if you make a load tests where 20.000 clients will hit different blobs storages from the same Azure Storage Account, this limits can be reached. How we can detect this problem? From client, we can detect that this limits was reached based on the HTTP error code that is returned by HTTP