Showing posts with label SQL Azure. Show all posts
Showing posts with label SQL Azure. Show all posts

Sunday, January 23, 2011

Local Development on SQL Azure

There seems to be lot of confusion about how to develop locally on SQL Azure. Basically, if you are an existing .net develper who is just starting to play with Azure; it's very common to look for a download that you can install in your dev environment that coudl simulate SQL Azure. Well.. It doesn't exist !!

Here are few pointers:

1. SQL Azure is a DB hosted by Microsoft in the cloud. You cannot install it.
2. To use SQL Azure, you will need to subscribe to one of the offerings from Microsoft. Typically, 3 months free introductory special is a good place to start while you decide what your exact needs are. 
3. There is no special SDK/tool needed to connect to SQL Azure DB. Existing data accessing frameworks like Entity Framework, LINQ to SQL, etc will work with SQL Azure.
4. You will need SQL Server Management Studio 2008 R2 to be able to connect to SQL Azure and run queries. SSMS does not provide advanced GUI to manage SQL Azure yet like on-premise SQL installations. But I have seen Denali preview and it's going to add whole new set of features in terms of what you can do with SQL Azure.
5. SQL Azure is NOT 100% on-premise MS SQL. For example, it supports only a subset of the T-SQL availabe in on-premise version. Many admin features are also not available. One good way to ensure that your code would run in SQL Azure without much issues would be to develop against SQL Express edition.
6. One other good area to understsand would be the   DB size limitation in SQL Azure, driven by your Azure subscription level. Currently, the maximum available DB size is 50 GB. Microsoft is about a launch a new offering to be able to create horizontal partitions of SQL Azure DBs as a way to scale up beyond 50 GB.
   
 I hope it helped. See you in cloud!!

Sunday, November 07, 2010

SQL Azure Federation: Horizontal Scaling in Cloud !!

  One of the concerns I hear a lot about Azure is the need for users to select the DB size when signing up for a SQL Azure instance. The maximum DB size that you can sign up for is 50 GB currently, and  makes lot of peopel worried about the scalability of SQL Azure. 50GB may be good enough for most of small and medium size web applciations, it's nowhere near what many large websites, LOB applications and data warehouses need.

     Microsoft's solution to this problem was something called  "Sharding".  Sharding is a technique that has been in existence for long time now and supports horizontal partitioning of Databases. Essentailly, it requires you to create a bunch of Azure DBs, treat each one as a separate partition, and programmatically direct your query to the correct partition “shard”. If it's a complex query, you will have to do the hard work of breaking it up based on your partition key, and redirect to right partition, and merge the result back.
   Here is one article explains how to sclae out SQL Azure using Horizontal partitioning. The partitioning logic is implemented in Data Access Layer  using LINQ. Painful!!

  Although this solution works, but expecting developers to write their own  logic to manage partitions, redirect queries, etc is little over the edge. Since most of the on-premise DBs provide this feature out of box, it was a big hurdle in SQL Azure adoption by large companies. Microsoft unvieled a much elegant solution duirng PDC.
   It's called "SQL Azure Federation" . It is planned to be released in early 2011.

   SQL Azure will provide support for explicit horizontal partitioning complete with support for new T-SQL keywords and commands like CREATE/USE/ALTER FEDERATION and CREATE TABLE...FEDERATE ON. Once you have setup the right federation key, re-directing queries to correct "shard" is taken care by the SQL Azure Engine.

  This new feature essentially makes the 50GB size limitation almost irrelevant for most of the data storage requirements. This coupled with the elastic "provisioning" nature of the cloud will make it a compelling alternative for many organizatiosn out there who are dealing with large datasets and scalability issues. I, for one, cannot wait to try this out.

Here is the actual session by "Lev Novik" from the PDC titled "Building Scale-Out Database Solutions on SQL Azure":

Cheers!!