views:

423

answers:

2

I am thinking of developing a Silverlight application and want to make use of Windows Azure for the data storage (as well as scalability etc). But I am not sure how to get data to and from Azure using Silverlight. What technologies should I be investigating? What is the recommended approach for this scenario?

Should I be looking at using the Entity Framework from Silverlight? But then how would the EF get data from Azure and even more importantly get changes saved back again? Or do I need to go for something more custom?

+1  A: 

Check out .NET RIA Services:

Build a Simple Application with .Net RIA Services (Silverlight 3)

Creating applications with .NET RIA Service Part 1 - Introduction

Mitch Wheat
DOes it work with Windows Azure? Can I use Azure to host and provide the Data?
Phil Wright
Yes. http://social.msdn.microsoft.com/Forums/es-ES/windowsazure/thread/1dbb09e7-6742-4e08-8a44-b870dd98b424
Mitch Wheat
+1  A: 

Basically, you're going to use Azure Table Storage to store the data and Blob storage if you have really large (> 64K) data elements. Table Storage and Blob Storage have REST interfaces, and you should look at the StorageClient sample in the Azure SDK as a way to CRUD the data. You can use these interfaces (Table and Blob) exclusively if you don't plan on exposing a public API.

However, lets say you want to be the next Twitter, and you want to expose a REST interface to the public... Even though Azure Table Storage has it's own REST interface, you create a small WCF service in a web role that exposes some specific WCF methods in a more compelling way. You can also publish your data in JSON, which could be more useful to non-Windows data consumers.

Here's a page that I found really helpful:

Azure Application Part 3: Expose (REST) Web Service And Consume in Silverlight.

And if you'd like to see my example, http://www.netalerts.mobi/traffic exposes data that's stored in Azure Table Storage. http://www.netalerts.mobi/traffic/api.aspx describes the REST apis that are public. In my implementation I call Table Storage via REST, manipulate the data, and then serve it up again in the public api.

ChrisW