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:
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
- 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
Comments
Post a Comment