﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>SDS</title>
    <description>SQL Server's Cloud implementation</description>
    <link>http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/BlogId/5/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>carpdeus@gmail.com</managingEditor>
    <webMaster>carpdeus@gmail.com</webMaster>
    <pubDate>Thu, 11 Mar 2010 20:39:33 GMT</pubDate>
    <lastBuildDate>Thu, 11 Mar 2010 20:39:33 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.5.1.19887</generator>
    <item>
      <title>SDS Thoughts on 5he Bus Ride to Work</title>
      <description>It appears that I will be doing a presentation on SQL Data Services in June &lt;br /&gt;at VSLive Las Vegas. When I first put the proposal together, I had a general &lt;br /&gt;idea and outline. That was a couple of months ago and, since then, the SDS &lt;br /&gt;team has been very quiet. They recently announced big new things coming in a &lt;br /&gt;new version, probably for this MIX, so I need to go through my outline and &lt;br /&gt;figure out what I can work on now that is generic, cloud information and &lt;br /&gt;will have to change my specifics after the release. &lt;p /&gt;I actually am giving two talks, one on SDS and another on Microsoft's &lt;br /&gt;caching service but al of my demo code for both rely on SDS. So it is going &lt;br /&gt;to bean interesting few months, since Velocity is due to release a new &lt;br /&gt;version at MIX and I should be able to benchmark it against a memcached &lt;br /&gt;instance. My belief is that memcached will win in performance and Velocity &lt;br /&gt;will win on al of the features that make it not a memory-based cache. I say &lt;br /&gt;that because items like fail-over and redundancy, while nice, do sort of &lt;br /&gt;defeat the notion of a cache per se. &lt;p /&gt;But, for the rest of today's bus ride, I think I will work on an SDS &lt;br /&gt;outline.  </description>
      <author>carpdeus@gmail.com</author>
      <comments>http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/134/SDS-Thoughts-on-5he-Bus-Ride-to-Work.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/134/SDS-Thoughts-on-5he-Bus-Ride-to-Work.aspx</guid>
      <pubDate>Fri, 27 Feb 2009 21:07:40 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.reluctantdba.com/DesktopModules/Blog/Trackback.aspx?id=134</trackback:ping>
    </item>
    <item>
      <title>The End of JOINs, Part 2</title>
      <description>&lt;p&gt;As I was saying last &lt;strike&gt;week&lt;/strike&gt; &lt;strike&gt;month&lt;/strike&gt; year in this &lt;a href="http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/96/The-End-of-JOINs.aspx" target="_blank"&gt;post&lt;/a&gt;, JOINs in SQL Data Services are not the same as they are in SQL Server. I'd recommend going back to review that post but the upshot of it is that SDS processes JOINs differently.&lt;/p&gt;  &lt;p&gt;Using a JOIN in SQL Server can have two possible uses. The first is to bring data together, so that columns from one table appear seamlessly with another table in the result set; the second is to filter data, the only JOIN that SDS supports if you use their JOIN command. But that doesn't mean that you can't JOIN data seamlessly between data sets, you just need to use &lt;a href="http://en.wikipedia.org/wiki/XSLT" target="_blank"&gt;Extensible Stylesheet Language Transformations&lt;/a&gt; (XSLT).&lt;/p&gt;  &lt;p&gt;XSLT is a way to manipulate XML data, using an XSLT Engine to transform XML into something else, in this case, an &lt;a href="http://en.wikipedia.org/wiki/XHTML" target="_blank"&gt;XHTML&lt;/a&gt; document. If you look at the generated XML (&lt;a href="http://www.reluctantdba.com/Portals/0/SampleCode/CalendarOfEventsLoad.zip" target="_blank"&gt;zip file here&lt;/a&gt;), you can see that it alternates between a web site entry and then the calendar entries for that web site. One way to process the XML would be to walk the XML in code and generate output. But the XSLT Engine handles that for you, all we need to do is to tell the engine how to process the data. Below is the pertinent part of the XSLT:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;xsl:for-each select="//WebSite"&gt;     &lt;br /&gt;   &lt;xsl:sort select="WebSiteID" /&gt;       &lt;br /&gt;   &lt;xsl:variable name="kWebSiteID" select="WebSiteID"/&gt;      &lt;br /&gt;            &lt;xsl:for-each select="//CalendarEntry[WebSiteID=$kWebSiteID]"&gt;      &lt;br /&gt;              &lt;xsl:sort select="EventDate" /&gt;      &lt;br /&gt;            &lt;/xsl:for-each&gt;      &lt;br /&gt; &lt;/xsl:for-each&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;On the plus side, the engine handles the transformation from XML into XHTML with just a few lines of code:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;string rawXML = calender.GetData("calendar-of-events", SDSQuery.ToString());     &lt;br /&gt;XPathDocument doc = new XPathDocument(new StringReader(rawXML));      &lt;br /&gt;XslTransform xslt = new XslTransform();      &lt;br /&gt;MemoryStream strm = new MemoryStream();      &lt;br /&gt;XmlTextReader xrdr = new XmlTextReader("SDS_JoinExample.xslt");// (new StringReader(xsltTransformation));      &lt;br /&gt;xslt.Load(xrdr, null, null);      &lt;br /&gt;// Transform the document to the Writer      &lt;br /&gt;xslt.Transform(doc, null, strm);      &lt;br /&gt;strm.Position = 0;      &lt;br /&gt;string Output = new StreamReader(strm).ReadToEnd();&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I've got a class, Events, that handles the call to the SDS and returns XML. We need to load that XML into an XPathDocument. Then the XSLT Transform and finally execute the Transform. Those few lines of code can off load a great deal of work. That's a good thing, in general, but it does highlight the problem I have with things like SDS: there's too much work being done elsewhere. I'll grant this sounds like a shell game since, whether the data gets merged at the data service or on the web server or the client, the same amount of work needs to be done; or does it? When SQL Server provides a JOINed result set, that data can be cached and returned for subsequent calls. If the web server makes the join and caches it, then the cache can be reused for clients it's serving but multiple web servers in a web farm will require multiple database calls. Finally, if the client handles the join then every call is probably going to need to hit the database.&lt;/p&gt;  &lt;p&gt;Cloud computing is good and can be beneficial, but you should consider all of the costs involved before jumping feet-first into it.&lt;/p&gt;  &lt;p&gt;Download the sample code &lt;a href="http://www.reluctantdba.com/Portals/0/SampleCode/SDS_JOIN.zip" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
      <author>carpdeus@gmail.com</author>
      <comments>http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/122/The-End-of-JOINs-Part-2.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/122/The-End-of-JOINs-Part-2.aspx</guid>
      <pubDate>Sun, 01 Feb 2009 01:41:45 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.reluctantdba.com/DesktopModules/Blog/Trackback.aspx?id=122</trackback:ping>
    </item>
    <item>
      <title>The End of JOINs?</title>
      <description>&lt;p&gt; So, I'm playing around with SQL Data Services (SDS), one of Microsoft's Cloud Databases. (see more &lt;a target="_blank" style="text-decoration: none; color: rgb(0, 51, 102); " href="http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/threads/"&gt;here&lt;/a&gt;, signup for&lt;a target="_blank" style="text-decoration: none; color: rgb(0, 51, 102); " href="http://msdn.microsoft.com/en-us/sqlserver/dataservices/default.aspx"&gt;Public CTP here&lt;/a&gt;). And it requires some shifts from the way that things are normally done. I've got a demo that I talk about&lt;a target="_blank" style="text-decoration: none; color: rgb(0, 51, 102); " href="http://www.reluctantdba.com/Default.aspx?tabid=411&amp;EntryId=94"&gt;here&lt;/a&gt;, but I've made some changes since then. The original demo only had one "table", a calendar of events. I've updated that&lt;a target="_blank" style="text-decoration: none; color: rgb(0, 51, 102); " href="http://www.reluctantdba.com/Portals/0/SampleCode/CalendarOfEventsLoad.zip"&gt;Zip file&lt;/a&gt; to now include another "table".&lt;/p&gt;&lt;a href=http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/96/Default.aspx&gt;More...&lt;/a&gt;</description>
      <link>http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/96/Default.aspx</link>
      <author>carpdeus@gmail.com</author>
      <comments>http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/96/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/96/Default.aspx</guid>
      <pubDate>Thu, 20 Nov 2008 23:28:59 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.reluctantdba.com/DesktopModules/Blog/Trackback.aspx?id=96</trackback:ping>
    </item>
    <item>
      <title>Calendar of Events -- S[S]DS</title>
      <description>&lt;p&gt; &lt;/p&gt;&lt;a href=http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/94/Default.aspx&gt;More...&lt;/a&gt;</description>
      <link>http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/94/Default.aspx</link>
      <author>carpdeus@gmail.com</author>
      <comments>http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/94/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.reluctantdba.com/DBAsAndProgrammers/Blog/tabid/411/EntryId/94/Default.aspx</guid>
      <pubDate>Wed, 19 Nov 2008 03:10:06 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.reluctantdba.com/DesktopModules/Blog/Trackback.aspx?id=94</trackback:ping>
    </item>
  </channel>
</rss>