{"id":510,"date":"2011-12-12T07:20:00","date_gmt":"2011-12-12T07:20:00","guid":{"rendered":"\/blogs\/bobb\/post\/SQL-Azure-Federations-are-here-At-least-on-my-server.aspx"},"modified":"2011-12-12T07:20:00","modified_gmt":"2011-12-12T07:20:00","slug":"sql-azure-federations-are-here-at-least-on-my-server","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/","title":{"rendered":"SQL Azure Federations are here. At least on my server&#8230;"},"content":{"rendered":"<p>\nLate tonight I tried something that I didn&#39;t think would work because @@version on SQL Azure didn&#39;t report anything different from last week. (Microsoft SQL Azure (RTM) &#8211; 11.0.1814.30 Nov 21 2011 16:46:09 Copyright (c) Microsoft Corporation). It didn&#39;t work last week. But it does work now. That&#39;s the last time I listen to @@version&#8230; \ud83d\ude09 This thing that works&nbsp;is&#8230;\n<\/p>\n<p>\nCREATE FEDERATION foo (id bigint range);\n<\/p>\n<p>\nThat&#39;s right&#8230;SQL Azure federations are up and appear to be working. At least on my server. They do a rolling upgrade in SQL Azure, so they be not yet be in all servers.&nbsp;If you&#39;ve missed reading about these in the recent past, Cihan Biyikoglu is one of the &quot;fathers&quot; of the SQL Azure Federation implementation, and he&#39;s written all about it, for months, <a href=\"http:\/\/blogs.msdn.com\/b\/cbiyikoglu\/\" class=\"broken_link\">in his blog<\/a>. He was a special guest at SQLskills&#39; week 4 immersion event that I gave in August and gave a talk there, mostly&nbsp;on federations.&nbsp;The CREATE FEDERATION DDL statement isn&#39;t available on the web yet, so <a href=\"http:\/\/blogs.msdn.com\/b\/cbiyikoglu\/archive\/2010\/10\/30\/building-scalable-database-solution-in-sql-azure-introducing-federation-in-sql-azure.aspx\" class=\"broken_link\">that&#39;s where to get it<\/a> to try it out.\n<\/p>\n<p>\nNote: You can also do this on the new SQL Azure Management portion of the Windows Azure portal. Select a database on your SQL Azure server, choose &quot;Manage&quot; off the ribbon at the top. You&#39;ll need to sign on again. Choose the &quot;Administration&quot; entry at the bottom right, then on administration page, it&#39;s the &quot;New&quot; button on the left of the top riboon (whew, that was harder to describe than it was to do).\n<\/p>\n<p>\n<strong>BIG NOTE<\/strong>: Since I get the impressions that federations will likely be cost items, THIS WILL LIKELY COST YOU MONEY. Don&#39;t say I didn&#39;t warn you, if it does. I don&#39;t know how much. The c<span style=\"line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt\">orollary<\/span> is DROP FEDERATION foo;\n<\/p>\n<p>\nFolks that are familiar with patitioning can think of federations as similar to partitioning, but with federations in SQL Azure you can&#39;t do SQL statements that cross federation members yet (i.e. no built-in fan-out queries or joins between federated tables and tables that live outside the federation member). Good thing we all know what map-reduce means from the Dr David Dewitt talk at SQLPASS this year. Folks that are more familiar with data-dependent routing (a.k.a. data-directed routing) like to draw parallels to this technology and its use in scale-out. There&#39;s lots of information on data-directed routing, I even wrote about it in a whitepaper called &quot;<a href=\"http:\/\/technet.microsoft.com\/library\/Cc917714\">Planning, Implementing, and Administering Scaleout Solutions with SQL Server 2005<\/a>&quot;, once upon a time. And some folks like to liken federations to NoSQL variant that uses the, ah, SQL language.\n<\/p>\n<p>\nWhatever you&#39;d like to compare it to, if you want federations to work with your application, you&#39;ll need to design for it. You can start by thinking in terms of three different types of tables: federated tables, reference tables, and global tables. Federated tables must have the federation key as part of the table&#39;s key in the SQL Azure implementation. So if the federation key is a customer id, orders can be a federated table if you make customerid part of its key. You can even stretch it to order_details containing the composite orders key that contains customer id. I have a harder time thinking of the products table working that way.\n<\/p>\n<p>\nIf you want to join order_details and products, you can make products a reference table. A reference table lives in every federation member. When you split a federation into two members, both members contain a full copy of the products table. BTW, these copies are not automatically kept in sync, so you&#39;d have to update all of them yourself. In case you&#39;re thinking as I was,&nbsp;we&#39;ll need to find out if&nbsp;Sync services for Azure will support reference tables in federation members right away.\n<\/p>\n<p>\nFinally, you can have global tables, that don&#39;t know anything about the federation. These could be in the federation root (which keeps track of the federation member metadata but doesn&#39;t know about individual federated tables), or in a different SQL Azure database. Joins between federated tables on global tables, however, happen on the client\/middle-tier.\n<\/p>\n<p>\nSo, if you&#39;re interested in using SQL Azure Federations, the first thing to do is to think about what would make a good federation key. And what type of table each of your tables would be; federated, reference, or global. Cihan probably was a blog entry about this somewhere.\n<\/p>\n<p>\nCheers. And a big congrats to Cihan, Michael, and the rest of the team.\n<\/p>\n<p>\n@bobbeauch<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Late tonight I tried something that I didn&#39;t think would work because @@version on SQL Azure didn&#39;t report anything different from last week. (Microsoft SQL Azure (RTM) &#8211; 11.0.1814.30 Nov 21 2011 16:46:09 Copyright (c) Microsoft Corporation). It didn&#39;t work last week. But it does work now. That&#39;s the last time I listen to @@version&#8230; [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-510","post","type-post","status-publish","format-standard","hentry","category-sql-azure-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL Azure Federations are here. At least on my server... - Bob Beauchemin<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Azure Federations are here. At least on my server... - Bob Beauchemin\" \/>\n<meta property=\"og:description\" content=\"Late tonight I tried something that I didn&#039;t think would work because @@version on SQL Azure didn&#039;t report anything different from last week. (Microsoft SQL Azure (RTM) &#8211; 11.0.1814.30 Nov 21 2011 16:46:09 Copyright (c) Microsoft Corporation). It didn&#039;t work last week. But it does work now. That&#039;s the last time I listen to @@version&#8230; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Bob Beauchemin\" \/>\n<meta property=\"article:published_time\" content=\"2011-12-12T07:20:00+00:00\" \/>\n<meta name=\"author\" content=\"Bob Beauchemin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bob Beauchemin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/\",\"name\":\"SQL Azure Federations are here. At least on my server... - Bob Beauchemin\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\"},\"datePublished\":\"2011-12-12T07:20:00+00:00\",\"dateModified\":\"2011-12-12T07:20:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Azure SQL Database\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/sql-azure-database\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQL Azure Federations are here. At least on my server&#8230;\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\",\"name\":\"Bob Beauchemin\",\"description\":\"SQL Server Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\",\"name\":\"Bob Beauchemin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"caption\":\"Bob Beauchemin\"},\"sameAs\":[\"http:\/www.sqlskills.com\/blogs\/bobb\/\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Azure Federations are here. At least on my server... - Bob Beauchemin","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/","og_locale":"en_US","og_type":"article","og_title":"SQL Azure Federations are here. At least on my server... - Bob Beauchemin","og_description":"Late tonight I tried something that I didn&#39;t think would work because @@version on SQL Azure didn&#39;t report anything different from last week. (Microsoft SQL Azure (RTM) &#8211; 11.0.1814.30 Nov 21 2011 16:46:09 Copyright (c) Microsoft Corporation). It didn&#39;t work last week. But it does work now. That&#39;s the last time I listen to @@version&#8230; [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/","og_site_name":"Bob Beauchemin","article_published_time":"2011-12-12T07:20:00+00:00","author":"Bob Beauchemin","twitter_misc":{"Written by":"Bob Beauchemin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/","name":"SQL Azure Federations are here. At least on my server... - Bob Beauchemin","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website"},"datePublished":"2011-12-12T07:20:00+00:00","dateModified":"2011-12-12T07:20:00+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/sql-azure-federations-are-here-at-least-on-my-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/"},{"@type":"ListItem","position":2,"name":"Azure SQL Database","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/sql-azure-database\/"},{"@type":"ListItem","position":3,"name":"SQL Azure Federations are here. At least on my server&#8230;"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/","name":"Bob Beauchemin","description":"SQL Server Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e","name":"Bob Beauchemin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","caption":"Bob Beauchemin"},"sameAs":["http:\/www.sqlskills.com\/blogs\/bobb\/"],"url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/510","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/comments?post=510"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/510\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/media?parent=510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/categories?post=510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/tags?post=510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}