<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Your Data in the Cloud</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/cbiyikoglu/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/feed.xml</link>
    <description>Cihan Biyikoglu [twitter @cihangirb]</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:20:32 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Off to a brand new adventure...</title>
      <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/off-to-a-brand-new-adventure</link>
      <pubDate>Wed, 13 Mar 2013 23:33:00 GMT</pubDate>
      <dc:creator><![CDATA[Cihan Biyikoglu - SQL Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cbiyikoglu/2013/03/13/off-to-a-brand-new-adventure/</guid>
      <description><![CDATA[After over a decade at Microsoft, I decided to start on a new adventure.&nbsp;I moved to Microsoft...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">After over a decade at Microsoft, I decided to start on a new adventure.&nbsp;I moved to Microsoft from Informix and had a chance to work during the .Net 1.0&nbsp;wave, on SQL Server 2005 &amp; 2008, on HealthVault.com and finally on SQL Azure (a.k.a Azure SQL DB). It truly felt like being a kid in a toy store!</span></p>
<p><span style="font-size: small;">To those of you who are frequent readers, listeners and commenters, THANKS YOU! I had a chance to work with many of you over the years and learned a great deal about your experiences with these products. Thanks to everyone who read and reached out through twitter, this blog or walked into one of my session at conferences&nbsp;around the world, for your passion for technology,&nbsp;friendship, patience and your hard work. I truly enjoyed our interactions and I hope our roads cross again!</span></p>
<p><span style="font-size: small;">Twitter: <a href="https://twitter.com/cihangirb"><span style="color: #00749e;">@cihangirb</span></a></span><br /><span style="font-size: small;">Linkedin: <a href="https://www.linkedin.com/in/cihangirb"><span style="color: #00749e;">https://www.linkedin.com/in/cihangirb</span></a></span></p>
<p><span style="font-size: small;">Thanks</span></p>
<p><span style="font-size: small;">-cihan biyikoglu</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Database Scaling Done Right!</title>
      <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/database-scaling-done-right</link>
      <pubDate>Thu, 24 May 2012 14:10:44 GMT</pubDate>
      <dc:creator><![CDATA[Cihan Biyikoglu - SQL Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cbiyikoglu/2012/05/24/database-scaling-done-right/</guid>
      <description><![CDATA[FullScale 180 folks have a great post on windrows azure blog today. Trent’s post provides great...]]></description>
      <content:encoded><![CDATA[<p>FullScale 180 folks have a great post on windrows azure blog today. Trent’s post provides great insight into what it takes to building large scale database solutions and how sharding gets simplified with SQL Federations.</p>  <p>Want to read more… Here is the link.</p>  <p><a title="https://blogs.msdn.com/b/windowsazure/archive/2012/05/24/windows-azure-isv-blog-series-full-scale-180-tackles-database-scaling-with-windows-azure.aspx" href="https://blogs.msdn.com/b/windowsazure/archive/2012/05/24/windows-azure-isv-blog-series-full-scale-180-tackles-database-scaling-with-windows-azure.aspx">https://blogs.msdn.com/b/windowsazure/archive/2012/05/24/windows-azure-isv-blog-series-full-scale-180-tackles-database-scaling-with-windows-azure.aspx</a></p>  <p>Enjoy.</p>  <p>-cihan</p>]]></content:encoded>
    </item>
    <item>
      <title>Inside SQL Azure – Self-healing, Self-governing, Massively Scalable Database service in the Cloud.</title>
      <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/inside-sql-azure-self-healing-self-governing-massively-scalable-database-service-in-the-cloud</link>
      <pubDate>Sat, 24 Mar 2012 09:31:55 GMT</pubDate>
      <dc:creator><![CDATA[Cihan Biyikoglu - SQL Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cbiyikoglu/2012/03/24/inside-sql-azure-self-healing-self-governing-massively-scalable-database-service-in-the-cloud/</guid>
      <description><![CDATA[This is a talk I did a few weeks ago that will take you under the hood of SQL Azure. I cover the...]]></description>
      <content:encoded><![CDATA[<p>This is a talk I did a few weeks ago that will take you under the hood of SQL Azure. I cover the gateway to SQL Azure that manager billing, connectivity and some parts of T-SQL as well as Engine and surrounding services like load balancing and node governance and the fabric of SQL Azure that manages node health, replication and failover. Why is this all important to know you may ask... Well understanding all this allows you to build apps that are better citizens in the new cloud world. At the end I tie it all together with what you need to think about in your own apps when working with the service and talk about differences in app characteristics between SQL Server and SQL Azure.Even if you are not building an app on SQL Azure, today, If you want to get a deep understanding of services we built around SQL Server that make SQL Azure so unique, this is the talk to watch:</p>  <p><a href="https://technet.microsoft.com/en-us/edge/inside-sql-azure-self-governing-self-healing-massively-scalable-database-service-in-the-cloud">https://technet.microsoft.com/en-us/edge/inside-sql-azure-self-governing-self-healing-massively-scalable-database-service-in-the-cloud</a> </p>  <p align="center"><a href="https://technet.microsoft.com/en-us/edge/inside-sql-azure-self-governing-self-healing-massively-scalable-database-service-in-the-cloud"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/3343.image_6C613B1F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/3343.image_5F00_6C613B1F.png" width="497" height="313" /></a></p>  <p><a class="twitter-follow-button" href="https://twitter.com/cihangirb" data-show-count="false">Follow @cihangirb</a> <script type="text/javascript">// <![CDATA[
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://blogs.msdn.com//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
// ]]]]><![CDATA[></script></p>]]></content:encoded>
    </item>
    <item>
      <title>What would you like us to work on next?</title>
      <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/what-would-you-like-us-to-work-on-next</link>
      <pubDate>Tue, 28 Feb 2012 00:46:00 GMT</pubDate>
      <dc:creator><![CDATA[Cihan Biyikoglu - SQL Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cbiyikoglu/2012/02/28/what-would-you-like-us-to-work-on-next/</guid>
      <description><![CDATA[10 weeks ago we shipped federations in SQL Azure and it is great to see the momentum grow. This...]]></description>
      <content:encoded><![CDATA[<p>10 weeks ago we shipped federations in SQL Azure and it is great to see the momentum grow. This week, I'll be spending time with our MVPs in Redmond and we have many events like this where we get together with many of you to talk about what you'd like to see us deliver next on federations. I'd love to hear from the rest of you who don't make it to Redmond or to one of the conferences to talk to us; <strong>what would you like us to work on next?</strong> If you like what you see today, what would make it even better? if you don't like what you see today, why? what experience would you like to see taken care of, simplified? Could be big or small. Could be NoSQL or NewSQL or CoSQL or just plain vanilla SQL. Could be in APIs, tools or in Azure or in SQL Azure gateway or the fabric or the engine? Could be the obvious or the obscure...</p>
<p><strong><span style="font-size: small;">Open field; fire away and leave a comment or simply tweet #sqlfederations and tell us what you'd like us to work on next...</span></strong></p>
<p>Thanks</p>
<p>-cihan</p>]]></content:encoded>
    </item>
    <item>
      <title>OData and Federations: yes you can… Just ask Maxim</title>
      <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/odata-and-federations-yes-you-can-just-ask-maxim</link>
      <pubDate>Tue, 21 Feb 2012 14:14:33 GMT</pubDate>
      <dc:creator><![CDATA[Cihan Biyikoglu - SQL Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cbiyikoglu/2012/02/21/odata-and-federations-yes-you-can-just-ask-maxim/</guid>
      <description><![CDATA[In case you guys have not seen this; Maxim Glukhankov has a new sample on codeplex that shows how to...]]></description>
      <content:encoded><![CDATA[<p>In case you guys have not seen this; Maxim Glukhankov has a new sample on codeplex that shows how to set up OData on top of SQL Azure Federations. Just go under “Source Code” at the top and download!</p>  <blockquote>   <p><a href="https://odatafederation.codeplex.com/">https://odatafederation.codeplex.com/</a></p> </blockquote>  <p>Not every tool in the world natively understand federations today. OData simplifies life for a lot of the tools that can’t speak ‘<em>sqlfederations</em>’ yet and the list of OData consumers is full with great names like Excel! be able to query your federated data using Excel now that should appeal to many!</p>  <p>You can find the full list here; <a title="https://www.odata.org/consumers" href="https://www.odata.org/consumers">https://www.odata.org/consumers</a></p>  <p><strong>Browsers IE, Chrome, Safari etc; </strong>Most modern browsers allow you to browse Atom based feeds. Simply point your browser at one of the OData Producers.</p>  <p><a href="https://www.powerpivot.com/"><strong>Excel 2010</strong></a><strong>: </strong>PowerPivot for Excel 2010 is a plugin to Excel 2010 that has OData support built-in.</p>  <p><a href="https://www.odata.org/developers/odata-sdk"><strong>Client Libraries</strong></a><strong>: </strong>Client libraries are programming libraries that make it easy to consume OData services. We already have libraries that target: Javascript, PHP, Java, Windows Phone 7 Series, iPhone (Objective C) and .NET. For a complete list visit the OData SDK.</p>  <p><a href="https://odatahelper.codeplex.com/"><strong>OData Helper for WebMatrix</strong></a>: The OData Helper for WebMatrix and ASP.NET Web Pages allows you to easily retrieve and update data from any service that exposes its data using the OData Protocol.</p>  <p><a href="https://www.tableausoftware.com/"><strong>Tableau</strong></a><strong>: Tableau - an excellent client-side analytics tool - can now consume OData feeds</strong></p>  <p><a href="https://www.telerik.com/products/odata-support.aspx"><strong>Telerik RadGrid for ASP.NET Ajax</strong></a><strong>: </strong>RadGrid for ASP.NET Ajax supports automatic client-side databinding for OData services, even at remote URLs (through JSONP), where you get automatic binding, paging, filtering and sorting of the data with Telerik Ajax Grid.</p>  <p><a href="https://www.telerik.com/products/odata-support.aspx"><strong>Telerik RadControls for Silverlight and WPF</strong></a><strong>: </strong>Being built on a naturally rich UI technology, the Telerik Silverlight and WPF controls will display the data in nifty styles and custom-tailored filters. Hierarchy, sorting, filtering, grouping, etc. are performed directly on the service with no extra development effort.</p>  <p><a href="https://www.telerik.com/products/odata-support.aspx"><strong>Telerik Reporting</strong></a><strong>: </strong>Telerik Reporting can connect and consume an existing OData feed with the help of WCF Data Services.</p>  <p><a href="https://fishcodelib.com/Database.htm"><strong>Database .NET v3</strong></a><strong>: </strong>Database .NET v3 - A free, easy-to-use and intuitive database management tool, supports OData</p>  <p><a href="https://pebblereports.com/odata/"><strong>Pebble Reports</strong></a><strong>: </strong>Pebble Reports lets you create reports consisting of tables, charts and crosstabs. Reports can be exported to Word, Excel and PDF formats, or emailed via Outlook.</p>]]></content:encoded>
    </item>
    <item>
      <title>Implementing MERGE command using SQL Azure Migration Wizard by @gihuey</title>
      <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/implementing-merge-command-using-sql-azure-migration-wizard-by-gihuey</link>
      <pubDate>Mon, 20 Feb 2012 10:09:17 GMT</pubDate>
      <dc:creator><![CDATA[Cihan Biyikoglu - SQL Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cbiyikoglu/2012/02/20/implementing-merge-command-using-sql-azure-migration-wizard-by-gihuey/</guid>
      <description><![CDATA[Well I am sure you noticed that federation&rsquo;s support SPLIT AT and DROP AT commands but not...]]></description>
      <content:encoded><![CDATA[Well I am sure you noticed that federation&rsquo;s support SPLIT AT and DROP AT commands but not MERGE AT yet today. What would this MERGE command do? It would do the symmetric opposite of SPLIT. SPLIT introduces a new split point into the federation. So MERGE would glue that back together. Here is what that would look like in real life; imagine a member layout like member#1: 0 to 50 and member#2: 50 to 100 range. MERGE would bring back these 2 members into a single member with a command like this: (note: by the time we are done with it it could be a different syntax.)

<blockquote>   <font color="#0000ff" face="Consolas">ALTER FEDERATION &hellip; MERGE AT (key=50)</font></p> </blockquote>

<p>This operation would move the data back into a single member that would cover all federated data in 0..100. MERGE AT would also allow transactions to still continue to happen on the 2 source members: 0..50 and 50..100, while the system rearranges the data back into a single member and would <strong>not</strong> require any downtime. 

Some do ask why we did not implement MERGE? Sure, we could have waited until MERGE is implemented to light up federations but many customers told us that they won&rsquo;t need MERGE right away and they do need SPLIT AT badly. Given the original pricing model in SQL Azure MERGE also didn&rsquo;t make sense. Not so any more&hellip; The new pricing model explained here, gives you benefits when you combine members into larger sizes. 

So what can you do today, until we get MERGE done? Big thanks to George Huey (@gihuey), here is a very timely article that talks about how to implement MERGE yourself using SQL Azure Migration Wizard to take advantage of the new pricing model and pay less. There are a few limitations; it isn&rsquo;t a single simple high level command like ALTER FEDERATION and it does require downtime for your app so not online but it can be done! <strong>Take a look under the section titled &ldquo;scaling down&rdquo; for details</strong>.

<p><a title="https://msdn.microsoft.com/en-us/magazine/hh848258.aspx" href="https://msdn.microsoft.com/en-us/magazine/hh848258.aspx">https://msdn.microsoft.com/en-us/magazine/hh848258.aspx</a></p>]]></content:encoded>
    </item>
    <item>
      <title>The New Pricing Model for SQL Azure Explained!</title>
      <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/the-new-pricing-model-for-sql-azure-explained</link>
      <pubDate>Thu, 16 Feb 2012 16:53:00 GMT</pubDate>
      <dc:creator><![CDATA[Cihan Biyikoglu - SQL Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cbiyikoglu/2012/02/16/the-new-pricing-model-for-sql-azure-explained/</guid>
      <description><![CDATA[The new pricing model is an amazing improvement over the original model. In 60 seconds here are the...]]></description>
      <content:encoded><![CDATA[<p>The new pricing model is an amazing improvement over the original model. In 60 seconds here are the 2 major improvements you will notice:</p>
<p><strong>#1 - New 100MB Option:</strong> Smaller databases has been a big ask. If you do not have a multi-tenant database tier, this may be the way to go given you can have many tenants. The story is told better with this picture. This is just going up to database capacity going up to 10GB. Look at that bottom left corner. that is the 0.1GB database.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/0435.image_0D353455.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/0435.image_5F00_0D353455.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/4743.image_thumb_6CADF4A2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/4743.image_5F00_thumb_5F00_6CADF4A2.png" width="795" height="353" /></a></p>
<p><strong>#2 - Granular Increments: </strong>The new model introduces 1GB Increments as opposed to the original jump points : 1-5-10-20-30-40-50-150&hellip;GB. The picture looks so different that I think it is easier to begin telling the story with the only that didn&rsquo;t change: 1GB database capacity. That is still $9.99 but everything else simply improved for customers. Not only do we have granular increments but we no longer have business edition starting at 10GB. You can have a 100MB business edition database and still pay 4.99 a month instead of 99.99. All these sound fantastic to all of you but the engineering team is in tears &ndash; just like that VWJetta&nbsp;commercial. Just to help you appreciate the price difference, here is the full picture to show you savings all the way up to 150GB databases. We have saving over %78 for some of the segments.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/1425.image_7360FE25.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/1425.image_5F00_7360FE25.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/7382.image_thumb_00C7112C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/7382.image_5F00_thumb_5F00_00C7112C.png" width="798" height="355" /></a></p>
<p>One important point to remember is; for this price, you are not only getting database storage for this price! Beyond just storage in database, the simplified price measurement on database-GBs in SQL Azure also include rich TSQL language with stored procedures for high performance query processing as well as transactional processing, the built in high availability and worry free physical administration you get with SQL Azure</p>
<p>&nbsp;</p>
<p>For more information here are a few useful links;</p>
<p>Pricing Federations in SQL Azure: <a href="https://blogs.msdn.com/b/cbiyikoglu/archive/2011/12/12/billing-model-for-federations-in-sql-azure-explained.aspx">https://blogs.msdn.com/b/cbiyikoglu/archive/2011/12/12/billing-model-for-federations-in-sql-azure-explained.aspx</a></p>
<p>Price Calculator: <a title="https://www.windowsazure.com/en-us/pricing/calculator/" href="https://www.windowsazure.com/en-us/pricing/calculator/">https://www.windowsazure.com/en-us/pricing/calculator/</a></p>
<p>Pricing Details: <a title="https://www.windowsazure.com/en-us/pricing/details/" href="https://www.windowsazure.com/en-us/pricing/details/">https://www.windowsazure.com/en-us/pricing/details/</a></p>
<p>Offers: <a title="https://www.windowsazure.com/en-us/pricing/purchase-options/" href="https://www.windowsazure.com/en-us/pricing/purchase-options/">https://www.windowsazure.com/en-us/pricing/purchase-options/</a></p>
<p>Pay by Invoice option: <a title="https://www.windowsazure.com/en-us/pricing/invoicing/" href="https://www.windowsazure.com/en-us/pricing/invoicing/">https://www.windowsazure.com/en-us/pricing/invoicing/</a></p>
<p>Thanks!</p>]]></content:encoded>
    </item>
    <item>
      <title>Fan-out Querying for Federations in SQL Azure (Part 2): Scalable Fan-out Queries with TOP, ORDER BY, DISTINCT and Other Powerful Aggregates, MapReduce Style!</title>
      <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/fan-out-querying-for-federations-in-sql-azure-part-2-scalable-fan-out-queries-with-top-order-by-distinct-and-other-powerful-aggregates-mapreduce-style</link>
      <pubDate>Thu, 19 Jan 2012 14:03:18 GMT</pubDate>
      <dc:creator><![CDATA[Cihan Biyikoglu - SQL Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cbiyikoglu/2012/01/19/fan-out-querying-for-federations-in-sql-azure-part-2-scalable-fan-out-queries-with-top-order-by-distinct-and-other-powerful-aggregates-mapreduce-style/</guid>
      <description><![CDATA[Welcome back. In the previous post: Introduction to Fan-out Querying, we covered the basics and...]]></description>
      <content:encoded><![CDATA[<p>Welcome back. In the previous post: <a href="https://blogs.msdn.com/b/cbiyikoglu/archive/2011/12/29/introduction-to-fan-out-queries-querying-multiple-federation-members-with-federations-in-sql-azure.aspx" target="_blank">Introduction to Fan-out Querying</a>, we covered the basics and defined the fragments that make up the fan-out query namely the member and summary queries. Fan-out querying refer to querying multiple members.</p>  <p>We looked at queries examples in the previous post with member queries with no summary queries, that is the member queries were simply UNIONed. In this post, we’ll take a look at Summary queries. when are they needed? what are some common patterns and examples? </p>  <p>Summary queries are required for post processing the member queries. Simply put, summary queries can help reshape the unioned member results into the desired final share. Summary queries refer to object generated by the member queries and depending on the implementation can be executed on the client side or the server side. That said, today Federations do not provide a built in server side processing option for summary queries. Here are a few options for processing summary queries:</p>  <p>- <strong>LINQ To DataSets</strong> offers a great option for querying datasets. Some examples <a href="https://msdn.microsoft.com/en-us/library/bb386991.aspx">here</a>. LINQ is best suited for the job in my opinion with flexible language constructs, dynamic execution and parallelism options. </p>  <p>- <strong>ADO.Net Expressions </strong>in DataSets offers a number of options for summary query processing as well. For example, <a href="https://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx">DataColumn.Expressions</a> allow you to add aggregate expressions to your Dataset for this type of processing. Or you can use <a href="https://msdn.microsoft.com/en-us/library/system.data.datatable.compute.aspx">DataTable.Compute</a> for processing a rollup value. </p>  <p>- Obviously <strong>server-side full fan-out</strong> processing is also an option. This option refers to server side running member and summary query in a single round-trip from the client to SQL Azure. However as of Jan 2012, this is not built into SQL Azure Federations. We’ll take a look at a simulated version of this in the sample tool here; You can use the deployment closer to your database for efficiency;</p>  <blockquote>   <p>Americas Deployment: <a href="https://federationsutility-scus.cloudapp.net/">https://federationsutility-scus.cloudapp.net/</a>       <br clear="all" />European Deployment: <a title="https://federationsutility-weu.cloudapp.net/" href="https://federationsutility-weu.cloudapp.net/">https://federationsutility-weu.cloudapp.net/</a>       <br clear="all" />Asian Deployment: <a title="https://federationsutility-seasia.cloudapp.net/" href="https://federationsutility-seasia.cloudapp.net/">https://federationsutility-seasia.cloudapp.net/</a>&#160;</p> </blockquote>  <p>The tool provides a basic and full ‘fanout’ page. Basic page contains only member queries through a simplified interface. The results are simply unioned (or ‘union all’-ed to be precise) together. Full page provides additional capabilities including member and summary queries. Both member and summary queries is expressed in TSQL. The full page also allows for parallelism and allows specifying a federation key range other than all members. Tool has a help page with detailed notes on each of these capabilities. </p>  <p>Lets dive in and take a look at where summary queries can be useful. We’ll start with Ordering, TOP, aggregations and finally DISTINCT processing. By the way, for the examples in this post, I’ll continue to use the BlogsRUs_DB schema posted at the bottom of this article.</p>  <p><strong>GROUP BY and HAVING with Fan-out Queries</strong></p>  <p>With simple group-by items the rule is simple; if the grouping is aligned to the federation key in fan-out queries in federations, processing of group-by and having needs no special consideration. Simply union the results (or union-all to be precise) and we are done. However processing unaligned groupings (any grouping that does not include the federation key) requires a summary query. </p>  <p>When grouping isn’t aligned to federation key, grouping isn’t completely done with member queries. that means processing HAVING will generate incorrect results in member queries. Lets take the example form the previous post; here is the query simply reporting the months and counts of posts with more than a million posts;</p>  <p><font color="#0000ff" face="Consolas">SELECT DATEPART(mm, be.created_date) mon, COUNT(be.blog_entry_title) cnt      <br />FROM blog_entries_tbl be       <br />GROUP BY DATEPART(mm, be.created_date)       <br clear="all" />HAVING COUNT(be.blog_entry_title) &gt; 100000</font></p>  <p>The grouping on month in each member yields the results from each member but grouping all members isn’t fully done yet! We need to GROUP_BY the same columns and expressions to finish grouping before we can apply the HAVING predicate. </p>  <p>So to correctly process HAVING predicate, we need to push t to the summary query;</p>  <p><font color="#0000ff" face="Consolas">SELECT DATEPART(mm, be.created_date) mon, COUNT(be.blog_entry_title) cnt      <br />FROM blog_entries_tbl be       <br />GROUP BY DATEPART(mm, be.created_date)</font></p>  <p>and the summary query should process the HAVING.</p>  <p><font color="#0000ff" face="Consolas">SELECT mon, sum(cnt) FROM #Table      <br />GROUP BY mon       <br />HAVING sum(cnt) &gt; 100000</font></p>  <p><strong>‘ORDER BY’ and ‘TOP’ with Fan-out Queries:</strong></p>  <p>Lets start with ordering and TOP functionality in TSQL. The member queries can include ORDER BY and TOP but you will need the summary query to reprocess and finalize the ordering and top filtering of the member query results. Take the following example; The query is calculating the top 10 blogs created across the entire BlogsRUs_DB. Remember the blog_entries_tbl is federated on blog_id. </p>  <p><font color="#0000ff" face="Consolas">SELECT TOP 10 blog_entry_text FROM blog_entries_tbl      <br clear="all" />ORDER BY created_date DESC</font></p>  <p>Here is how to break this into a fan-out query with a member and a summary query; The #Table in the summary query refer to the resultset generated from the member query.</p>  <p>Member Query:    <br clear="all" /><font color="#0000ff" face="Consolas">SELECT TOP 10 blog_entry_text, created_date FROM blog_entries_tbl      <br clear="all" />ORDER BY created_date DESC       <br /></font>Summary Query:     <br clear="all" /><font color="#0000ff" face="Consolas">SELECT TOP 10 blog_entry_text FROM #Table      <br clear="all" />ORDER BY created_date DESC</font></p>  <p>Here is the output for the member query:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/7737.image_64F8A2B4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/7737.image_5F00_64F8A2B4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/4682.image_thumb_71F282C5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/4682.image_5F00_thumb_5F00_71F282C5.png" width="757" height="876" /></a></p>  <p>And the output with the summary query. Now the output only contains the true TOP 10 rows.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/7725.image_50FF101E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/7725.image_5F00_50FF101E.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/5353.image_thumb_7041B6F1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/5353.image_5F00_thumb_5F00_7041B6F1.png" width="762" height="715" /></a></p>  <p><strong>Additive Aggregates: MIN, MAX &amp; SUM with Fan-out Queries: </strong></p>  <p>When the processing of the MIN, MAX and SUM align with a grouping on the federation key, a UNION ALL of the results can simply yield the result. For example the count of blog entries per blog could be proceed with the following query;</p>  <p><font color="#0000ff" face="Consolas">SELECT blog_id, COUNT(blog_entry_id)      <br clear="all" />FROM blog_entries_tbl GROUP BY blog_id</font></p>  <p>Same applies to the OVER clause used for defining windows when processing aggregates. that is, as long as the PARTITION BY includes the federation key, a UNION ALL of the results is sufficient for the summary query. </p>  <p>However when the grouping does not align to the federation key, you will need summary queries. Here is the example that gets us the latest date that a blog entry was created. The grouping in the absence of a GROUP BY clause is a single bucket.</p>  <p><font color="#0000ff" face="Consolas">SELECT MAX(created_date) FROM blog_entries_tbl</font></p>  <p>Here is the way to break this down into a fan-out query;</p>  <p>Member Query:    <br clear="all" /><font color="#0000ff" face="Consolas">SELECT MAX(created_date) FROM blog_entries_tbl</font>     <br clear="all" />Summary Query:     <br clear="all" /><font color="#0000ff" face="Consolas">SELECT MAX(Column1) FROM #Table</font></p>  <p><strong>Fan-out Queries Processing AVG and COUNT</strong></p>  <p>Average is a none additive aggregate thus it takes a rewrite to take an average when grouping does not align to the federation key. Here is an example of an average aggregate that aligns with a federation key: the next query calculates the average days between the blog entry and the last comment for the post for bloggers. the inner query gets the MAX date for the last comment on the blog entry. AVG is calculated per blogger for all the blog entries with the days between the create date of the blog and the last comment date on all blog entry.</p> <font color="#0000ff" face="Consolas">SELECT blog_id, AVG(LEN(blog_entry_text))    <br />FROM blog_entries_tbl     <br clear="all" /></font><font color="#0000ff" face="Consolas">GROUP BY blog_id</font>   <p>There is no need for a summary query other than a UNION ALL of the results when fanning this query out given it is aligned to the federation key: blog_id.</p>  <p>However when the grouping is not aligned, there is work to do! Average and Count are not additive. That is, one cannot take 2 averages and average those to get the correct average or take 2 counts and use another count to calculate the output of 2 counts; we need SUM in the case of 2 counts to correctly get the final correct count and we need to use sum of values we want to average and the item count to calculate avg correctly from multiple member queries. Here is an example: Lets take the average length of blog entries across all each month. This time the grouping is on the month of the blog posts. </p>  <p><font color="#0000ff" face="Consolas">SELECT DATEPART(mm,be.created_date) month_of_entry,      <br clear="all" />&#160;&#160;&#160;&#160;&#160;&#160; AVG(LEN(blog_entry_text))       <br />FROM blog_entries_tbl       <br clear="all" /></font><font color="#0000ff" face="Consolas">GROUP BY DATEPART(mm,be.created_date)</font></p>  <p>Lets use SUM and COUNT to get to the correct average.</p>  <p>Member Query:    <br clear="all" /><font color="#0000ff" face="Consolas">SELECT DATEPART(mm,created_date) month_of_entry,&#160; <br clear="all" />&#160;&#160;&#160;&#160;&#160;&#160; SUM(LEN(blog_entry_text)) sum_len_blog_entry,&#160; <br clear="all" />&#160;&#160;&#160;&#160;&#160;&#160; COUNT(blog_entry_text) count_blog_entry       <br />FROM blog_entries_tbl       <br clear="all" />GROUP BY DATEPART(mm,created_date)</font></p>  <p>Summary Query:    <br clear="all" /><font color="#0000ff" face="Consolas">SELECT month_of_entry,      <br clear="all" />&#160;&#160;&#160;&#160;&#160;&#160; SUM(sum_len_blog_entry)/SUM(count_blog_entry) avg_len_blog_entry       <br />FROM #Table       <br clear="all" />GROUP BY month_of_entry</font></p>  <p><strong>‘DISTINCT’ with Fan-out Queries:</strong></p>  <p>DISTINCT is fairly easy to calculate much like the other additive aggregates. As long as the grouping is on the federation key. When grouping isn’t aligned to the federation key, a summary query reapplying the distinct for de-duplication is needed. Here is the query for DISTINCT count of languages used for blog comments across our entire dataset;</p>  <p><font color="#0000ff" face="Consolas">SELECT DISTINCT bec.language_id      <br />FROM blog_entry_comments_tbl bec JOIN language_code_tbl lc       <br clear="all" />&#160;&#160;&#160;&#160; ON bec.language_id=lc.language_id</font></p>  <p>To break this apart, you have to run distinct in each member and then rerun the distinct on the summary query much like MIN and MAX;</p>  <p>Member Query:    <br clear="all" /><font color="#0000ff" face="Consolas">SELECT DISTINCT bec.language_id      <br />FROM blog_entry_comments_tbl bec JOIN language_code_tbl lc       <br clear="all" />&#160;&#160;&#160;&#160; ON bec.language_id=lc.language_id       <br clear="all" /></font>Summary Query:     <br clear="all" /><font color="#0000ff" face="Consolas">SELECT DISTINCT language_id FROM #Table</font></p>  <p>Now lets take a look at some more challenging none additive aggregates. </p>  <p><strong>Fan-out Queries with TON N PERCENT and DISTINCT COUNT </strong></p>  <p>TOP N PERCENT is not as popular as TOP N but for those who use it, lets dissect what you need to do with fanout queries. TOP N PERCENT simply require you collect all results without TOP from members and only apply the TOP N PERCENT in the summary query. Imagine the same query we used for TOP with TOP 10 PERCENT. Query gets latest 10% blog entries. </p> <font color="#0000ff" face="Consolas">SELECT TOP 10 PERCENT blog_entry_text FROM blog_entries_tbl    <br clear="all" />ORDER BY created_date DESC</font>   <p>Here are the member and summary queries. </p>  <p>Member Query:    <br clear="all" /><font color="#0000ff" face="Consolas">SELECT blog_entry_text FROM blog_entries_tbl      <br clear="all" />ORDER BY created_date DESC       <br /></font>Summary Query:     <br clear="all" /><font color="#0000ff" face="Consolas">SELECT TOP 10 PERCENT blog_entry_text FROM #Table      <br clear="all" />ORDER BY create_date DESC</font></p>  <p>Alarm bell should go off whenever we are not able to push the filtration predicate (TOP clause) down to the member queries. So processing TOP N PERCENT is costlier that TOP N and additive keywords. </p>  <p>DISTINCT COUNT calculation is trivial if grouping is on the federation key. However when grouping isn’t aligned, it takes more work to calculate distinct count given that it isn’t additive. That means; you cannot simply add distinct-counts from each member given you may not know if you are counting certain things multiple times without full de-duplication of all the items. Here is an example; this query get the distinct count of languages per month across the whole resultset;</p> <font color="#0000ff" face="Consolas">SELECT DATEPART(mm,created_date), COUNT(DISTINCT bec.language_id)    <br />FROM blog_entry_comments_tbl bec JOIN language_code_tbl lc     <br />ON bec.language_id=lc.language_id     <br />GROUP BY DATEPART(mm,created_date)</font>   <p>We need to centralized processing so all comments language ids across days first need to be grouped across all members and then distinct can be calculated on that resultset. Here is the member and summary query for calculating distinct-count;</p>  <p>Member Query:    <br clear="all" /><font color="#0000ff" face="Consolas">SELECT DISTINCT DATEPART(mm,created_date), bec.language_id      <br />FROM blog_entry_comments_tbl bec JOIN language_code_tbl lc       <br />ON bec.language_id=lc.language_id</font></p>  <p>Summary Query:    <br clear="all" /><font color="#0000ff" face="Consolas">SELECT Column1, COUNT(DISTINCT language_id)      <br />FROM #Table       <br />GROUP BY Column1</font></p>  <p>Here is what the member query output looks like;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/3580.image_7F534590.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/3580.image_5F00_7F534590.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/7380.image_thumb_496E5076.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/7380.image_5F00_thumb_5F00_496E5076.png" width="698" height="726" /></a></p>  <p>Here is the output with the summary query;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/5557.image_04C1B635.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/5557.image_5F00_04C1B635.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/8863.image_thumb_1D515385.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/8863.image_5F00_thumb_5F00_1D515385.png" width="702" height="522" /></a></p>  <p>In conclusion, additive operations like MIN, MAX, COUNT or SUM and predicates like TOP or order by can easily be processed with fan-outs using simple modifications to original queries to break them into member and summary queries. With additive queries big advantage is that you can push these operation to the member queries for efficiencies. In cases where you need to deal with none-additive operations like average, there is some rewrite to help push filtrations and aggregate predicates to member queries. However there are a few cases like TOP N PERCENT or DISTINCT COUNT, where fan-out queries may require larger dataset shoveling thus will be more expensive to calculate because you cannot push these predicates to member queries and can only process them in the summary queries.</p>  <p>Happy fan-out querying. </p>  <p><a class="twitter-follow-button" href="https://twitter.com/cihangirb" data-show-count="false">Follow @cihangirb</a> <script type="text/javascript">// <![CDATA[
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://blogs.msdn.com//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
// ]]]]><![CDATA[></script></p>  <hr />  <p><strong>*Sample Schema </strong></p>  <p>Here is the schema I used for the sample queries above. </p>  <p><font color="#0000ff" face="Consolas"><font color="#4f81bd">-- Connect to BlogsRUs_DB</font>       <br />CREATE FEDERATION Blogs_Federation(id bigint RANGE)       <br />GO       <br />USE FEDERATION blogs_federation (id=-1) WITH RESET, FILTERING=OFF       <br />GO       <br />CREATE TABLE blogs_tbl(       <br />blog_id bigint not null,       <br />user_id bigint not null,       <br />blog_title nchar(256) not null,       <br />created_date datetimeoffset not null DEFAULT getdate(),       <br />updated_date datetimeoffset not null DEFAULT getdate(),       <br />language_id bigint not null default 1,       <br />primary key (blog_id)       <br />)       <br />FEDERATED ON (id=blog_id)       <br />GO       <br />CREATE TABLE blog_entries_tbl(       <br />blog_id bigint not null,       <br />blog_entry_id bigint not null,       <br />blog_entry_title nchar(256) not null,       <br />blog_entry_text nchar(2000) not null,       <br />created_date datetimeoffset not null DEFAULT getdate(),       <br />updated_date datetimeoffset not null DEFAULT getdate(),       <br />language_id bigint not null default 1,       <br />blog_style bigint null,       <br />primary key (blog_entry_id,blog_id)       <br />)       <br />FEDERATED ON (id=blog_id)       <br />GO       <br />CREATE TABLE blog_entry_comments_tbl(       <br />blog_id bigint not null,       <br />blog_entry_id bigint not null,       <br />blog_comment_id bigint not null,       <br />blog_comment_title nchar(256) not null,       <br />blog_comment_text nchar(2000) not null,       <br />user_id bigint not null,       <br />created_date datetimeoffset not null DEFAULT getdate(),       <br />updated_date datetimeoffset not null DEFAULT getdate(),       <br />language_id bigint not null default 1       <br />primary key (blog_comment_id,blog_entry_id,blog_id)       <br />)       <br />FEDERATED ON (id=blog_id)       <br />GO       <br />CREATE TABLE language_code_tbl(       <br />language_id bigint primary key,       <br />name nchar(256) not null,       <br />code nchar(256) not null       <br />)       <br />GO</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Introduction to Fan-out Queries for Federations in SQL Azure (Part 1): Scalable Queries over Multiple Federation Members, MapReduce Style!</title>
      <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/introduction-to-fan-out-queries-for-federations-in-sql-azure-part-1-scalable-queries-over-multiple-federation-members-mapreduce-style</link>
      <pubDate>Thu, 29 Dec 2011 14:55:00 GMT</pubDate>
      <dc:creator><![CDATA[Cihan Biyikoglu - SQL Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cbiyikoglu/2011/12/29/introduction-to-fan-out-queries-for-federations-in-sql-azure-part-1-scalable-queries-over-multiple-federation-members-mapreduce-style/</guid>
      <description><![CDATA[Happy 2012 to all of you! 2011 has been a great year. We now have federations live in production...]]></description>
      <content:encoded><![CDATA[Happy 2012 to all of you! 2011 has been a great year. We now have federations live in production with SQL Azure. So lets chat about fanout querying.

<strong>What is a fan-out query?</strong>

Federations provide a model for partitioning parts of your schema over to multiple member databases for harnessing scalability of many nodes. However applications still need for querying all of the data across federation members. Fan-out is a technique for querying data in your federation, across many federation members. Fan-out queries are much like map/reduce in that it is formed in 2 parts;

<ul>  <li><em><strong>Member query</strong></em> is the piece that is sent over to all members involved in the query and</li>  <li><strong><em>Summary query </em></strong>is the query that is the post processing piece to allow condensing the results from the member query to desired final result-set.</li>  </ul>

With fan-out queries the <em>member</em> query is always there but <em>summary</em> query may not be needed. For example if you are simply doing DML (we&rsquo;ll have some examples like data pruning or reference data management etc) or DDL (we&rsquo;ll look at schema deployment in detail below), fan-out would only have a member query but no <em>summary</em> query is needed. It is only when you need post processing, you need the <em>summary</em> query.

Last I want to say that fan-out queries are not exotic animals. Member query generates a resultset that is fed into the summary query to allow post processing. This kind of staged processing of results is something that many SQL developers already do in their stored procedure logic. This kind of results pipeline is similar to cases where you choose to use temp tables or table variables for staging the results in similar ways. OR if you have used CTEs (common table expressions) or views, you are using them to stage your processing or abstract processing logic to multiple stages. The shape of fan-out queries is a deliberate breakdown of the query processing based on your federation key but have great similarity to other techniques built into TSQL.

In the rest of the post, I&rsquo;ll give you a tour of a tool and sample code that lets you do fanout processing and detail how to write fan-out queries with examples. Lets drill in.

<strong>Fan-out Query Utility</strong>

The sample utility is there to show how easy it is to execute fanout queries. Source for the sample is available on the site. You can visit the live version of the tool here; Recommend using the deployment closer to your SQL Azure deployment for efficiency;

<blockquote>  Americas Deployment: <a href="https://federationsutility-scus.cloudapp.net/">https://federationsutility-scus.cloudapp.net/</a> <br clear="all">European Deployment: <a title="https://federationsutility-weu.cloudapp.net/" href="https://federationsutility-weu.cloudapp.net/">https://federationsutility-weu.cloudapp.net/</a> <br clear="all">Asian Deployment: <a title="https://federationsutility-seasia.cloudapp.net/" href="https://federationsutility-seasia.cloudapp.net/">https://federationsutility-seasia.cloudapp.net/</a></p>  </blockquote>

<p>The basic fan-out query utility page shows you an example of a tool that can do member query. We will cover other parts of the tool in future posts but <em>member</em> queries are dead simple so wanted to show this for those of you who are looking for ways to deploy schema, maintain ref data etc. Simply go under the Home Menu and select the Fan-out Query Utility to access the page;

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/8877.image_4ADF2F8B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/8877.image_5F00_4ADF2F8B.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/8468.image_thumb_77F41C59.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/8468.image_5F00_thumb_5F00_77F41C59.png" width="790" height="562"></a>

The tool simply take a connection string, federation name a query and executes the query (or batch) in all federation members. You can also get to the source code for the page through the link.

the member query is executed with the button click event for the &ldquo;<em>Submit Fanout Query&rdquo;</em>. Lets quickly walk through the code first;

<ul>  <li>First the connection is opened and three federation properties are initialized for constructing the USE FEDERATION statement: federation name, federation key name and the minimum value to take us to the first member.</li>  </ul>

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">49: // open connection <br>50: cn_sqlazure.Open(); <br>51:&nbsp;&nbsp;&nbsp; <br>52: //get federation properties <br>53: str_federation_name = txt_federation_name.Text.ToString(); <br>54:&nbsp;&nbsp;&nbsp; <br>55: //get distribution name <br>56: cm_federation_key_name.Parameters["@federationname"].Value = str_federation_name; <br>57: str_federation_key_name = cm_federation_key_name.ExecuteScalar().ToString(); <br>58:&nbsp;&nbsp;&nbsp; <br>59: cm_first_federation_member_key_value.Parameters["@federationname"].Value = str_federation_name; <br>60: cm_next_federation_member_key_value.Parameters["@federationname"].Value = str_federation_name; <br>61:&nbsp;&nbsp;&nbsp; <br>62: //start from the first member with the absolute minimum value <br>63: str_next_federation_member_key_value = cm_first_federation_member_key_value.ExecuteScalar().ToString();</span>

<ul>  <li>In the loop, the app constructs and executes the USE FEDERATION routing statement using the above three properties and through each iteration connect to the next member in line.</li>  </ul>

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">67: //construct command to route to next member&nbsp; <br clear="all">68: cm_routing.CommandText = string.Format("USE FEDERATION {0}({1}={2}) WITH RESET, FILTERING=OFF", str_federation_name , str_federation_key_name , str_next_federation_member_key_value);&nbsp; <br clear="all">69:&nbsp;&nbsp;&nbsp;&nbsp; <br clear="all">70: //route to the next member&nbsp; <br clear="all">71: cm_routing.ExecuteNonQuery();</span>

<ul>  <li>Once the connection to the member is established to the member, query is executed through the DataAdapter.Fill method. The great thing about the DataAdapter.Fill method is that it automatically appends the rows or merges the rows into the DataSet.DataTables so as we iterate over the members, there is no additional work to do in the DataSet.</li>  </ul>

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">76: //get results into dataset <br>77: da_adhocsql.Fill(ds_adhocsql);</span>

<ul>  <li>Once the execution of the query in the current member is complete, app grabs the range_high of the current federation member. Using this value, in the next iteration the app navigates to the next federation member. The value is discovered through &ldquo;<em>select cast(range_high as nvarchar) from sys.federation_member_distributions</em>&rdquo;</li>  </ul>

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">86: //get the value to navigate to the next member <br>87: str_next_federation_member_key_value = cm_next_federation_member_key_value.ExecuteScalar().ToString();</span>

<ul>  <li>The condition for the loop is defined at line#71. Simply expresses looping until the range_high value returns NULL.</li>  </ul>

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">89: while (str_next_federation_member_key_value != String.Empty);</span>

Fairly simple!

<strong>What can you do with Fan-out Query Utility tool? </strong>

Here are a few simple examples for member queries;

First, you can use the tool to do <strong>schema deployments to federations</strong>; To deploy schema to all my federation members, simply put a DDL statement in the query window&hellip; And it will run it in all federation members;

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">CREATE TABLE language_code_tbl( <br>&nbsp;&nbsp;&nbsp; id bigint primary key, <br>&nbsp;&nbsp;&nbsp; name nchar(256) not null, <br>&nbsp;&nbsp;&nbsp; code nchar(256) not null); </span>

I can also <strong>maintain reference data in federation members</strong> with this tool; Simply do the necessary CRUD to get the data into a new shape or simply delete and reinsert language_codes;

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">TRUNCATE TABLE language_code_tbl <br>INSERT INTO language_code_tbl VALUES(1,'US English','EN-US') <br>INSERT INTO language_code_tbl VALUES(2,'UK English','EN-UK') <br>INSERT INTO language_code_tbl VALUES(3,'CA English','EN-CA') <br>INSERT INTO language_code_tbl VALUES(4,'SA English','EN-SA')</span>

Here is how to <strong>get the database names and database ids for all my federation members</strong>;

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">SELECT db_name(), db_id() </span>

Here is what the output looks like from the tool;

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/0508.image_0E1EEA0D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/0508.image_5F00_0E1EEA0D.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/6283.image_thumb_744AB3DD.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/6283.image_5F00_thumb_5F00_744AB3DD.png" width="727" height="123"></a><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/2161.image_49061CD6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/2161.image_5F00_49061CD6.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/2654.image_thumb_1AAC9729.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/2654.image_5F00_thumb_5F00_1AAC9729.png" width="727" height="326"></a>

Here are more ways to gather information from all federation members: This will <strong>capture information on connections to all my federation members</strong>;

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">SELECT b.member_id, a.* <br>FROM sys.dm_exec_sessions a CROSS APPLY sys.federation__member_distributions b</span>

&hellip;Or I can do <strong>maintenance with stored procedures kicked off in all federation members</strong>. For example, here is how to update statistics in all my federation members;

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">EXEC sp_updatestats</span>

For querying user data: Well, I can do queries that &lsquo;Union All&rsquo; the results for me. Something like the following query where I get blog_ids and blog_titles for everyone who blogged about &lsquo;Azure&rsquo; from my blogs_federation. By the way, you can find the full schema at the bottom of the post under the title &lsquo;Sample Schema&rdquo;.

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">SELECT b.blog_id, b.blog_title <br>FROM blogs_tbl b JOIN blog_entries_tbl be <br>ON b.blog_id=be.blog_id <br>WHERE blog_entry_title LIKE '%Azure%'</span>

I can also do aggregations as long as grouping involves the federation key. That way I know all data that belongs to each group is only in one member. For the following query, my federation key is blog_id and I am looking for the count of blog entries about &lsquo;Azure&rsquo; per blog.

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">SELECT b.blog_id, COUNT(be.blog_entry_title), MAX(be.created_date)&nbsp; <br>FROM blogs_tbl b JOIN blog_entries_tbl be <br>ON b.blog_id=be.blog_id <br>WHERE be.blog_entry_title LIKE '%Azure%' <br>GROUP BY b.blog_id</span>

<strong>When do you need to think about a Summary Query? </strong>

Fanout queries with a simple member query is quite simple. However there are many cases you will need a <strong><em>summary</em> query </strong>when writing fanout queries as well. Here is how you know that you need a <em>summary</em> query: If all you want to do it UNION ALL the results from member query, you don&rsquo;t need a summary query. If I would like to do post processing such as order the whole resultset, aggregates data and get a grouping (GROUP BY) that does not align with the federation key, you need a summary query.

We&rsquo;ll cover summary queries in a future &ldquo;Part 2&rdquo; post but as a teaser I&rsquo;ll throw a few examples:

Imagine that I&rsquo;d like to get the count of blog entries about &lsquo;Azure&rsquo; that are created between Aug (8th month) and Dec (12th month) of the years.

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">SELECT DATEPART(mm, be.created_date), COUNT(be.blog_entry_title) <br>FROM blogs_tbl b JOIN blog_entries_tbl be <br>ON b.blog_id=be.blog_id <br>WHERE DATEPART(mm, be.created_date) between 8 and 12 <br>AND be.blog_entry_title LIKE '%Azure%' <br>GROUP BY DATEPART(mm, be.created_date)</span>

Here is the query results;

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/6874.image1_0C6E1E39.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/6874.image1_5F00_0C6E1E39.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/4214.image1_thumb_39EF3DFC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/4214.image1_5F00_thumb_5F00_39EF3DFC.png" width="765" height="842"></a>

What&rsquo;s wrong with this output? Well I was looking for a single row with full count for all blogs created on Aug 8th but I got a whole bunch of rows from each member.

Lets say I wanted to get the top 5 blog_ids with the busiest comment traffic. Here is TOP 5 query returning many more than 5 rows;

<span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">SELECT TOP 5 COUNT(*) <br>FROM blog_entry_comments_tbl <br>GROUP BY blog_id <br>ORDER BY 1</span>

Just to make things exciting, I added the CROSS APPLY to sys.federation_member_distributions. that shows you the results are coming from many members. So the second column in the output below is the RANGE_LOW of the member the result is coming from.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/3755.image_6CBA4B53.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/3755.image_5F00_6CBA4B53.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/7360.image_thumb_1E45B8E9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/7360.image_5F00_thumb_5F00_1E45B8E9.png" width="774" height="858"></a>

Well, I think you get the idea. I&rsquo;ll cover how we can process such queries using summary queries in Part II of the post.

So to wrap up, fan-out queries is the technique to execute queries across your federation members. With fanout queries, there are 2 parts to consider;

1- First, the part you execute in each federation member, that is the <strong><em>member </em>query </strong>and

2- Second, the query part called <strong><em>summary </em>query </strong>that is used to collapse the results from all members to a single result-set.

Yes this all sounds familiar: It is like map-reduce! The great thing about fan-out querying is that it can be done completely in parallel. All the member queries are executed by separate databases in SQL Azure. The down side is that you need to now consider your federation key and write 2 queries instead of 1.

Please let me know if you have feedback about that and everything else on this post; just comment on this blog post or contact me through the link that says &lsquo;contact the author&rsquo;.

Thanks and happy 2012!

<a class="twitter-follow-button" href="https://twitter.com/cihangirb" data-show-count="false">Follow @cihangirb</a>

If you like to read more about fan-out queries, here is <a href="https://blogs.msdn.com/b/cbiyikoglu/archive/2012/01/19/fan-out-querying-in-federations-part-ii-summary-queries-fanout-queries-with-top-ordering-and-aggregates.aspx">Part 2</a>&nbsp;of the article.  <script type="text/javascript">// <![CDATA[  !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://blogs.msdn.com//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");  // ]]]]><![CDATA[></script>  

<hr>

<h6>*Sample Schema</h6>

Here is the schema I used for the sample queries above.

<span style="font-family: consolas; color: #9bbb59;" color="#9bbb59" face="Consolas"><span style="color: #4f81bd;" color="#4f81bd">-- Connect to BlogsRUs_DB</span> <br></span><span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">CREATE FEDERATION Blogs_Federation(id bigint RANGE) <br>GO <br>USE FEDERATION blogs_federation (id=-1) WITH RESET, FILTERING=OFF <br>GO <br>CREATE TABLE blogs_tbl( <br>blog_id bigint not null, <br>user_id bigint not null, <br>blog_title nchar(256) not null, <br>created_date datetimeoffset not null DEFAULT getdate(), <br>updated_date datetimeoffset not null DEFAULT getdate(), <br>language_id bigint not null default 1, <br>primary key (blog_id) <br>) <br>FEDERATED ON (id=blog_id) <br>GO <br>CREATE TABLE blog_entries_tbl( <br>blog_id bigint not null, <br>blog_entry_id bigint not null, <br>blog_entry_title nchar(256) not null, <br>blog_entry_text nchar(2000) not null, <br>created_date datetimeoffset not null DEFAULT getdate(), <br>updated_date datetimeoffset not null DEFAULT getdate(), <br>language_id bigint not null default 1, <br>blog_style bigint null, <br>primary key (blog_entry_id,blog_id) <br>) <br>FEDERATED ON (id=blog_id) <br>GO <br>CREATE TABLE blog_entry_comments_tbl( <br>blog_id bigint not null, <br>blog_entry_id bigint not null, <br>blog_comment_id bigint not null, <br>blog_comment_title nchar(256) not null, <br>blog_comment_text nchar(2000) not null, <br>user_id bigint not null, <br>created_date datetimeoffset not null DEFAULT getdate(), <br>updated_date datetimeoffset not null DEFAULT getdate(), <br>language_id bigint not null default 1 <br>primary key (blog_comment_id,blog_entry_id,blog_id) <br>) <br>FEDERATED ON (id=blog_id) <br>GO <br>CREATE TABLE language_code_tbl( <br>&nbsp;&nbsp;&nbsp; language_id bigint primary key, <br>&nbsp;&nbsp;&nbsp; name nchar(256) not null, <br>&nbsp;&nbsp;&nbsp; code nchar(256) not null <br>&nbsp;&nbsp;&nbsp; ) <br>GO</span>

<p><span style="font-family: consolas; color: #0000ff;" color="#0000ff" face="Consolas">&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>…So Isn’t the Root Database a Bottleneck for Federations in SQL Azure?</title>
      <link>https://docs.microsoft.com/archive/blogs/cbiyikoglu/so-isnt-the-root-database-a-bottleneck-for-federations-in-sql-azure</link>
      <pubDate>Thu, 15 Dec 2011 12:39:38 GMT</pubDate>
      <dc:creator><![CDATA[Cihan Biyikoglu - SQL Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/cbiyikoglu/2011/12/15/so-isnt-the-root-database-a-bottleneck-for-federations-in-sql-azure/</guid>
      <description><![CDATA[Dan posted a great comment to my previous blog post and I think the question he is raising is worth...]]></description>
      <content:encoded><![CDATA[<p>Dan posted a great comment to my previous blog post and I think the question he is raising is worth a blog post! Thanks for the question Dan!</p>  <p>Here is Dan’s question:</p>  <blockquote>   <p><em>Dan - Tue, Dec 13 2011 11:57 AM</em></p>    <p><em>Cihan, thanks for keeping us all posted all the way until the D-day the 12th.</em></p>    <p><em>Having followed your posts and some Azure documentation (so far limited), there is 1 simple but key question that keeps bugging me, my team and quite likely many other developers - so far I have not found any reasonable explanation and I fail to understand on <strong>HOW and WHY having ALL(!) federation member requests go ALWAYS(!) through ONE(!) Federation Root DB would eliminate the SQL performance bottleneck problem that we are trying to get away with</strong>???</em></p>    <p><em>…</em></p> </blockquote>  <p>This is a common confusion I think we create with the root database but root, besides holding onto some metadata, really does not do the processing of transactions when it comes to federations. In fact, unless you have specific processing requests that happen in the root, root stays pretty idle. This is the magic of the USE FEDERATION statement. </p>  <p>Before I go into the detail of USE FEDERATION, let me dive into some architectural details of SQL Azure. SQL Azure physically has a separate layer in front of the database nodes called the services layer (a.k.a the gateway). Services layer owns managing connectivity, translation of logical to physical server names, some TSQL processing and a few other services. Services layer does some complicated TSQL processing; In fact processing of USE FEDERATION statement and all other CREATE/ALTER/DROP FEDERATION statements are done by the services layer not the platform layer (or the database nodes) in SQL Azure. Services layer is a scaled out tier and SQL Azure configuration controls the number of <em>gateway</em> nodes per cluster in SQL Azure. You can see the detailed picture of the layers below. You can find more details on SQL Azure architecture <a href="https://msdn.microsoft.com/en-us/library/windowsazure/ee336271.aspx" target="_blank">here</a>. </p>  <p><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="Four layers of SQL Azure architecture" alt="Four layers of SQL Azure architecture" src="https://i.msdn.microsoft.com/dynimg/IC414906.gif" /></p>  <p>Connections from your applications are distributed over to the services layer nodes through a load balancer. When a connection from a client application comes in, one of the services layer nodes handle the connection, translate which physical server now contains the logical server and database name in the connection string and establishes the connection to the database node in the platform layer. </p>  <p>Ok, so lets go back to federations and how federation do their processing: With federations, applications use the name of the root database in their connection string. At this point, a connection from the app to the services layer node is established (white arrows) and a connection from the services layer node to the root database node is established or if a pooled connection already exists to the root database it is reused (blue arrow).</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/0218.image_1829010E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/0218.image_5F00_1829010E.png"><img style="border: 0px currentcolor; margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/6175.image_thumb_69CF7B60.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/6175.image_5F00_thumb_5F00_69CF7B60.png" width="800" height="410" /></a></p>  <p>In federation model, before you do transactional processing we require that you issue a routing statement called USE FEDERATION to work with your scaled-out schema. USE FEDERATION takes a federation name, a federation key value and some attributes. When USE FEDERATION is received by the services layer, the connection from the app to the services layer stay intact but the connection from the services layer to the database node is switched over to the federation member that contain the federation key value provided in the USE FEDERATION statement. So if you execute;</p>  <blockquote>   <p><em>“USE FEDERATION orders_federation(tenant_id=155) …”</em></p> </blockquote>  <p>Connection from the application to Node#1 in services layer stays intact but the the services layer switches the connection from the root database to the federation member that contain tenant_id value 155 (white arrow from gateway node#1 to orders_federation member database node)</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/0207.image_3E1EB164.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/0207.image_5F00_3E1EB164.png"><img style="border: 0px currentcolor; margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/43/47/metablogapi/1803.image_thumb_5C88F24D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-43-47-metablogapi/1803.image_5F00_thumb_5F00_5C88F24D.png" width="800" height="410" /></a></p>  <p>After this point all transaction processing, aside from a few TSQL statement gateway nodes process, happen directly on the federation member node. All your stored procedure executions to queries directly work with the node that contain the federation member which contains tenant_id 155. Each federation member and root database is spread over to various nodes in the platform layer so as more processing hit other federation members that contain tenant_id 655 or 1055, other nodes in the platform layer is engaged in processing those transactions. </p>  <p>At this point you may say, fine the transactional processing is decentralized but how about processing of USE FEDERATION itself? The information in the root database is the only way to figure out which federation member has tenant_id=155 or 655 or 1055? SQL Azure services layer is smart about that as well: For processing this connection routing, gateway nodes do caching of federation metadata and pooling of connections to process the USE FEDERATION command itself. That means while the cache and pool is getting built the root database receive queries asking for the federation map but after things get warmed up, services layer nodes do the heavy lifting.</p>  <p>So with the magic of USE FEDERATION statement both the processing of connection routing and the transaction processing in federation is decentralized! that gives you the ability to do processing much beyond capacity limits of a single node!</p>  <p>Hope this helps explain your question Dan!</p>  <p>-cihan biyikoglu</p>]]></content:encoded>
    </item>
  </channel>
</rss>