Skip to main content

Service Bus Queues from Windows Azure - Business Scenarios

In the last month I talked about Service Bus Queue in a lot of blog posts. Let’s see some scenarios when we can use Service Bus Queues with success.

The first scenario can came from the world of hyper-markets, where we can have 50,60 or 70 cash machine. As a manager I’m interested to know the stock of my products all around the country. Based on this I can move goods from one deposit to another, or from a hyper-market to another. I don’t want to see the stock in real-time. A delay of 5-10 minutes is acceptable, but is very important for me to not lose items that are sold (I need to see the real-stock and not some estimations). Also even if this information is very important for me, I don’t want to invest a lot of money in an application and on servers that need to be maintained.
For this case, we can imagine a solution that use for communication Service Bus Queue. The cash machine sends to the queue the list of products that were sold. A central server has all the time from the world to consume products list and update the stocks. If we have a rush hour is not a problem for us because all the messages will be process in the end, without losing any messages. But what about holidays, for example Christmas, when is very important to know the stock in real time (we don’t want to be out of soda or sugar in December 22th. In this case we can scale and add more servers on the consumer side. If we are on Windows Azure with this then this is piece of cake.
Another interesting solution here is to use WCF and Service Bus Queue. In this way we will not rely on Windows Azure Services and it will be very easy to move from cloud to on-premises or to integrate another solution.

The second scenario put us in the educational system. We need to create a system that is able to centralize all the grades of students at the end of each trimester. Teachers can add data to this system in any moment of time, but because we need this information only at the end of trimester we don’t want to waste money on a server/s that run all the time to permit teachers to add this data. Also we should be able to store them until the end of trimester when we centralize them.
For this case, it would be very easily to create an application that sends this data to the queue. Because the TTL of a message from Service Bus Queue can be unlimited, we can persist this data very easily (and cheap). At the end of the trimester we can start a machine that consumes this data generating an output and creating an archive.
One great idea here. We can create a Metro Application for a Windows 8 Tablet where teacher can add this data. From the tablet the data is send directly to the queue. Because we have ACS claims and role-based access control on Service Bus Queue, all 3 of AAA can be satisfied.

In the last scenario we have a big restaurant chain that makes delivery at home. We want to be able to process the commands in the order that were submitted, we don’t want to lose any message.
For this scenario we can create a Service Bus namespace and create a queue for each work point. Based on the address from where the command is submitted we can add the command to the most appropriate restaurant. Service Bus Queue guarantees that each message will be processed in the order that he was added to the queue and also we will not lose any messages (this is a scenario where Service Bus Topics can be used with success also – but we will talk with another occasion).

What is important to know about Service Bus Queues?
Service Bus Queues can be a great solution when we want:
  • Loose coupling (consumer and producer don’t need to know each other – upgrades or changing one of the part can be made very easily)
  • Load leveling (we don’t have to run the consumer all the time)
  • Load balancing (we can add consumers or producer very easily)
  • Temporary decoupling (producer or consumer can be offline)
I hope this example made you to imagine some cases when Service Bus Queues can be our best friend and maybe you will use it or take into account for the next project.

Comments

  1. What I would be interested to find out: what are the differences between Azure service bus queues and Azure queue service.

    ReplyDelete
    Replies
    1. You can find the response in an older post wrote by me: http://vunvulearadu.blogspot.hu/2012/08/service-bus-queues-from-windows-azure_21.html

      Delete

Post a Comment

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