Search code examples
mongodbazureazure-table-storageazure-worker-rolesnosql

Windows Azure TDS emulation on a production non-Azure IIS server


I am developing a c# web application that will be hosted in Windows Azure and use Table Data Storage (TDS).

I want to architect my application such that I can also (as an option) deploy the application to a traditional IIS server with some other NoSql back-end. Basically, I want to give my customers the option to either pay me in the software as a service model, OR purchase a license of my application that they can install on a (non-azure) production server of their own.

How can I best architect my data layer and middle tier to achieve both goals?

I will likely need a Windows Azure Worker Role and an Azure Queue. How complicated is to replicate these? Can I substitue a custom Windows Service and some other queuing technology?

How I can the entities in my data model be written such that I can deploy to Azure TDS or some other storage when not deploying to Azure? Would MongoDB or similar be useful for this?

Surely there is a way to architect for Azure without being married to it.


Solution

  • I found a viable solution. I found that I can use EF Code First with SQL Server or SQL CE if I design my entities with the same PartitionKey & RowKey compound key structure that Azure Table Storage requires.

    With a little help from Lokad Cloud (http://code.google.com/p/lokad-cloud/) to perform the interaction with Azure Table Storage, I was able to craft a common DataContext that provides crud operations against either EF's DbContext OR Lokad's TableStorageProvider.

    I even found a nice way to manage relationships between entities and lazy-load them properly.

    The solution is a bit complex and needs more testing. I will blog about it and post the link here when ready.