Search results matching tags 'Azure', 'Cloud Computing', 'Computing', and 'Storage'http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&tag=Azure,Cloud+Computing,Computing,Storage&orTags=0Search results matching tags 'Azure', 'Cloud Computing', 'Computing', and 'Storage'en-USCommunityServer 2.1 SP2 (Build: 61129.1)Creating a Distributed Computing System Using a Windows Azure Queuehttp://sqlblog.com/blogs/buck_woody/archive/2011/10/11/creating-a-distributed-computing-system-using-a-windows-azure-queue.aspxTue, 11 Oct 2011 13:12:42 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:38990BuckWoody<p style="margin:0in 0in 0pt;" class="MsoNormal"><font size="3"><font color="#000000"><font face="Calibri">The Windows Azure Queue component, like all Windows Azure components (Roles, Storage, App Fabric, SQL Azure) can be used by itself or with other Windows Azure components. That’s why I refer to Windows Azure as “Distributed Computing” rather than “cloud”. </font></font></font></p> <p style="margin:0in 0in 0pt;" class="MsoNormal"><font color="#000000" size="3" face="Calibri"></font></p> <p style="margin:0in 0in 0pt;" class="MsoNormal"><font size="3"><font color="#000000"><font face="Calibri">Having a distributed off premise queue has a lot of use-cases. An interesting use-case is a company that wanted to harness the power of all of the PC’s and laptops in the company when they were not being used throughout the day. A developer wrote a screen-saver program that connected to an Azure Queue, pulling work off of the queue and placing an entry when it was done. In essence he had a partially connected distributed work relay system, and since he used a Windows Azure Queue, the system worked from anywhere in the world. </font></font></font></p> <p style="margin:0in 0in 0pt;" class="MsoNormal"> <p><font color="#000000" size="3" face="Calibri">&#160;</font></p> </p> <p style="margin:0in 0in 0pt;" class="MsoNormal"><font size="3"><font color="#000000"><font face="Calibri">He uses an on-site central server (which was actually only a workstation-level system) that holds the computations in a scatter/gather paradigm. The computations are broken into less-than-8K chunks, so that it fits within a message. The server connects to a Windows Azure Queue, and places the message marked for computation. It also scrubs the Queue for completed work, and as part of the process puts that kind of message into a mapping function (queues are not guaranteed a message order). </font></font></font></p> <p style="margin:0in 0in 0pt;" class="MsoNormal"> <p><font color="#000000" size="3" face="Calibri">&#160;</font></p> </p> <p style="margin:0in 0in 0pt;" class="MsoNormal"><font size="3"><font color="#000000"><font face="Calibri">The workstations that are not being used (even those systems at remote workers and travelers) connect to the same Windows Azure Queue when the system is not being used for a period of time, when the screen saver kicks in. It then takes one message from the queue, computes the information, and then sets a new message for the server to pick up with the answer. The workstation then deletes the message. </font></font></font></p> <p style="margin:0in 0in 0pt;" class="MsoNormal"> <p><font color="#000000" size="3" face="Calibri">&#160;</font></p> </p> <p style="margin:0in 0in 0pt;" class="MsoNormal"><font size="3"><font color="#000000"><font face="Calibri">The Server picks up the completed work, processes it and then deletes that queue message. He also added logic to process messages for computation on the server as well, when the server function of adding work is not required. </font></font></font></p> <p style="margin:0in 0in 0pt;" class="MsoNormal"> <p><font color="#000000" size="3" face="Calibri">&#160;</font></p> </p> <p style="margin:0in 0in 0pt;" class="MsoNormal"> <p><font color="#000000" size="3" face="Calibri"><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-79-79-metablogapi/2438.AzureQueueDistributedSystem_5F00_2.png"><img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="AzureQueueDistributedSystem" border="0" alt="AzureQueueDistributedSystem" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-79-79-metablogapi/3603.AzureQueueDistributedSystem_5F00_thumb.png" width="708" height="919" /></a></font></p> </p> <p style="margin:0in 0in 0pt;" class="MsoNormal"> <p>&#160;</p> </p> <p style="margin:0in 0in 0pt;" class="MsoNormal"><font size="3"><font color="#000000"><font face="Calibri">There are a few caveats here. This works because of the mapping function on the head server. Order is not guaranteed, so he includes a number for the function step as part of the message body, which cuts the size a bit. Also, he’s careful to watch the encoding, since Azure will hand binary back in Base64 format. </font></font></font></p> <p style="margin:0in 0in 0pt;" class="MsoNormal"> <p><font color="#000000" size="3" face="Calibri">&#160;</font></p> </p> <p style="margin:0in 0in 0pt;" class="MsoNormal"><font size="3"><font color="#000000"><font face="Calibri">He’s found that there are enough systems to ensure that the messages are cleared every few days – important, since the Windows Azure Queue ages out after seven days. Also, he’s careful to use the CloudQueue.PeekMessage function when he wants to monitor the system – that function ensures that the message status doesn’t reset as “read” when he accesses it. </font></font></font></p> <p style="margin:0in 0in 0pt;" class="MsoNormal"> <p><font color="#000000" size="3" face="Calibri">&#160;</font></p> </p> <p style="margin:0in 0in 0pt;" class="MsoNormal"><font size="3"><font color="#000000"><font face="Calibri">This is a great example of using the “cloud” as what it is intended to be – a distributed architecture you can use as needed to solve a business problem. It’s not an “all or nothing” proposition, but instead it is simply another set of components to use where you need them. </font></font></font></p>