Azure WCF webrole / Worker role confused..
I have several hardware devices that send large amount of data to the cloud. I need to store them on the cloud, process them and send some status reports based on the data analysed to clients who are interested in looking at those results. Clients are smart phone users.
A single client is interested in knowing one or more hardware status report.
I need to make this scalable using Azure, i.e be able to monitor 1000s of hardwares. I need cloud storage , cloud computing power and ability to send data from many hardwares and send reports to clients that are monitoring these hardwares.
I am new to WCF and Azure any guidance on how to write a scalable application using WCF and Azure will be very useful. Please explain how it can be scalable. Do I have to use worker role / web role ? I have some computationally intensive data processing to be done to produce the reports, that clients are interested in.
Sounds like an interesting project...
You can host WCF Services in a WCF Service Web Role, which is a web role with starting artifacts for hosting WCF services.
For entensive processing you can use worker roles. When data is received, a WCF service cam place a message on a Service Bus queue, which will be received by a worker role, which can process the data asynchronouslty.
For data storage you could look at the Table and Blob storage in Windows Azure Storage, or look at Windows Azure SQL Database if you need relational storage. There are advantages and disadvanteges to both approaches.
There is quite a lot of technology to evaluate, so it might be worth running through a few tutorials to get an idea of what will make for the best implementation. The Windows Azure Training Kit is a good starting place for this.
You can scale by increasing the instances of both Web and Worker roles based on the load. Azure roles (cloud service) is a stateless (wont support sticky sessions by default) hence the response of request from same client will be equally distributed to all your instances (round robin).
@coolshashi. By default one Azure Cloud Solution can consist of 5 different roles (the mix of Web or Worker doesn't matter). Each of those roles can have multiple instances. For example: 7 Instances of your Web Role could form your front-end Web Farm that places orders on a Service Bus Queue. These orders might be read by 2 instances of your Worker Role which processes them & put them into a database.
The only difference between a web & worker role is that the Web Role has IIS installed & started.
It is easy to configure the number of instances per role to dynamically change based on some metric you define (ie: CPU use or Messages in a Queue). So the solution can scale up to handle load & shrink to save money when not required.
Most Azure subscriptions (or accounts) are initially constrained to 20 cores. This is to prevent you from accidentally creating a massive bill. If your solution requires more, a quick chat to Microsoft can remove that limit to give you as much as you desire.