Moving to Azure: The Database

Azure has two main services for persistent data storage for application: Azure Table Storage and SQL Azure.  The really boil down to a normal SQL relational database, and an document based database.  Initially Azure had only Table Storage, but it appears Microsoft was ahead of the NoSQL movement that has become popular of late and they were met with a strong cry for SQL.  The good news is both options are robust and well supported, though in many cases its likely Table Storage will be cheaper than SQL.

GameMarx.com and XboxIndies.com share a single database.  The database is running on MS SQL Express 2008.  The sites are a good candidate for Table Storage.  Under the hood, all of the content is cached to disk in document format.  A game page on either site gets data from a single file that will contain all the data needed to render that page.  This simplifies the site down to pretty much applying a template to a data file for more requests and is quite speedy.  It was probably a premature optimization, as neither site does enough traffic to stress a modern database, but we built it for web scale.

Even though Table Storage is an option, time is a factor.  Since I can migrate the sites to Table Storage any time, I will start off using SQL Azure.  Thanks to reading Azure in Action I learned of the SQL Azure Migration Wizard.  This tool makes it easy to export from an MS SQL database and import the structure and data to SQL Azure.  SQL Azure is similar to MS SQL, but not a 100% match and requires several small tweaks to DDL statements.  The Wizard will make all of these tweaks, and alert you to any structures that are not SQL Azure ready (SQL Azure does not like tables without a primary key for example).

In our sites we are using the ASP.NET Membership Provider and I was concerned that database structures needed to support this would not import cleanly into SQL Azure.  I was glad to be wrong.  Our entire database imported cleanly and after changing my connections strings a local dev instance of the sites were running smoothly against SQL Azure.

There was one bump in the road, and that was I did not have SQL 2008 R2 SP1 installed locally, only SQL 2008 R2.  The Wizard requires SP1 to be installed, and if it’s not you’ll get some odd errors when you attempt to connect to SQL Azure.  The good news is the latest Management Studio includes support for  SQL Azure, so many things you can do via GUI instead of command line now.  The support isn’t prefect though, the add user option for example just launches a query window with an template for adding a user via SQL.

Can I be so lucky the rest of the move goes this smoothly?

Posted By Mike On Sunday, October 02, 2011
Filed under azure azuresql | No Comments

Submit this story to DotNetKicks   

Leave a comment



Your name:
 

Your email (not shown):
 
Will display your Gravatar image.

Your website (optional):



About Michael

Michael C. Neel, born 1976 in Houston, TX and now live in Knoxvile, TN. Software developer, currently .Net focused. Board member of ETNUG and organizes CodeStock, East Tennessee's annual developers conference. .Net speaker, a Microsoft ASP.NET MVP and ASPInsider. Co-Founder of FuncWorks, LLC and GameMarx.

Proud father of two amazing girls, Rachel and Hannah, and loving husband to Cicelie who inflates and pops his ego as necessary.

 Subscribe to ViNull.com |  Comments

Follow me on Twitter | Contact Me

Related Posts

Moving to Azure: Worker Roles for Nothing and Tasks for Free

If you’ve been to at least one Azure presentation you’ve probably heard Azure has two primary roles: Web Roles and Worker Roles.  Web Roles run websites, ... Read more

Moving to Azure: Static Assets

You may not have noticed, but this image came from the cloud! The next stage in migrating GameMarx.com and XboxIndies.com to Azure is moving the static ... Read more

Moving to Azure: The Plan and Start

After a conversation with my former webhost about the meaning of "Recurring Annual Discount" (we have different definitions of the word "Recurring"), ... Read more

Debugging Azure WebRoles with Multiple Sites

Microsoft Azure has added a cool ability to allow you to host more than one website in a WebRole.  You may know this feature better as named based ... Read more

XNA 3D Primer Examples Updated, XNA 2D Example Added, Talks on Both at DevLINK

Almost two years ago now I was working on a short ebook XNA 3D Primer (now in Kindle flavor).  A year after the book came out XNA 4.0 was released, ... Read more

XNA 3D Primer by Michael C. Neel

XNA 3D Primer by Michael C. Neel
Buy Now: [ Amazon ] [ Wrox ]

GameMarx

CodeStock

ASPInsiders Member

ETNUG Member