Search results matching tags 'Developer', 'Windows Azure', 'Development', and 'Azure Use Cases'http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&tag=Developer,Windows+Azure,Development,Azure+Use+Cases&orTags=0Search results matching tags 'Developer', 'Windows Azure', 'Development', and 'Azure Use Cases'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>Rip and Replace or Extend and Embrace?http://sqlblog.com/blogs/buck_woody/archive/2011/09/13/rip-and-replace-or-extend-and-embrace.aspxTue, 13 Sep 2011 11:20:05 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:38437BuckWoody<p>As most of you know, I don&rsquo;t like the term &ldquo;cloud&rdquo; very<br />much. It isn&rsquo;t defined, which means it can be anything. I prefer &ldquo;distributed<br />computing&rdquo;, which is more technically accurate and describes what you&rsquo;re doing<br />in more concrete terms.</p>
<p>So when you think about Windows and SQL Azure, you don&rsquo;t<br />have to think about an entire product &ndash; you can use parts of the system<br />together or independently to accomplish what you need to do. You can use the<br />computing functions, storage, and more and more I see folks leverage the<br />Service Bus to enable current applications to expose things to the web.</p>
<p>And that brings up the point of this post. Once you decide<br />that a distributed architecture works to solve a problem, you&rsquo;re faced with a<br />decision: should you completely re-write your architecture to take advantage of<br />the current systems or should you just fold in new code that makes the data or<br />function available to the web?</p>
<p>Of course, the answer is always &ldquo;it depends&rdquo; on the situation<br />&ndash; and it does. But unless you&rsquo;re fixing a problem with current code, I usually<br />advocate a migration approach. That means at the very least retaining the<br />business logic (again, unless it&rsquo;s not currently working) and as much of the<br />code as you can. In fact, if you follow this paradigm, you&rsquo;re on your way to<br />making a Service Bus out of the functions you currently have. You can expose<br />the results of a system rather than opening the system up. Let&rsquo;s take an<br />example.</p>
<p>Assume for a moment that you have an order-taking system<br />on-premise. That system performs many functions, one of which might creating a<br />Purchase Order. Your system might be enclosed, meaning that it has an<br />application that talks to a middle-tier, and then from there to a database<br />system. A query is generated from a screen, and passed along to eventually<br />compute, store and return a Purchase Order Number, along with other<br />information. Imagine now that you wire up the code not only to return the PO<br />number to the client, but to make that number available on an endpoint &ndash;<br />actually really not that hard to do.</p>
<p>Now you can make that PO number available to the web using<br />Azure. You could restrict who can make that call to the system, or open it up<br />to a broader audience. Or instead of the PO Number, you could make a product<br />list available. And you can go further than that &ndash; EBay, for instance, uses the<br />OData protocol (which is very cool in and of itself) which you can query from<br />the web. You could compare your company&rsquo;s product catalog to what is on EBay,<br />and list the items you have there if there are no competitors in that space.<br />And on and on it goes.</p>
<p>So the point is this &ndash; where you can, retain what works.<br />Fold in systems like Azure where they make sense. Extend and Embrace.</p>