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(

ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded

Today blog post will be started with the following error when running DB tests on the CI machine: threw exception: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. at System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName) This error happened only on the Continuous Integration machine. On the devs machines, everything has fine. The classic problem – on my machine it’s working. The CI has the following configuration: TeamCity .NET 4.51 EF 6.0.2 VS2013 It see

Navigating Cloud Strategy after Azure Central US Region Outage

 Looking back, July 19, 2024, was challenging for customers using Microsoft Azure or Windows machines. Two major outages affected customers using CrowdStrike Falcon or Microsoft Azure computation resources in the Central US. These two outages affected many people and put many businesses on pause for a few hours or even days. The overlap of these two issues was a nightmare for travellers. In addition to blue screens in the airport terminals, they could not get additional information from the airport website, airline personnel, or the support line because they were affected by the outage in the Central US region or the CrowdStrike outage.   But what happened in reality? A faulty CrowdStrike update affected Windows computers globally, from airports and healthcare to small businesses, affecting over 8.5m computers. Even if the Falson Sensor software defect was identified and a fix deployed shortly after, the recovery took longer. In parallel with CrowdStrike, Microsoft provided a too