views:

36

answers:

1

Is is possible for an Azure application to offer a service to end-users for carrying out long-running computation tasks that are going to be distributed over multiple Workers (with persistent storage)?

And would it be possible to provide this through a web-service that is accessed by a desktop .Net application (the View) or do you always need to use a web-interface with Azure?

+1  A: 

Azure easily handles WCF-hosting, and you can make your WCF endpoint either internal (for just an Azure hosted app) or external (for a locally-installed app). Try this: create a new Azure cloud application, and add a WCF Service Web Role. This will essentially host WCF in IIS, and will provide you with what you're looking for.

Also look at my response here for information about a patch needed for WCF hosting.

Finally: about distributed processing: if your processing is done as an atomic action, yet you simply want to scale how many things you can process, this is very straightforward! You just create a worker role that reads from a queue and processes the next item. Then, your WCF service simply enqueues a request for work to be done. When the worker role completes the task and writes its results to storage, it reads the next request. You can then scale your number of worker role instances to process requests across a set of VM instances. If, on the other hand, you want to process an individual work item across several worker roles, you'll need to create some type of custom mechanism for instructing your individual worker role instances. For this, you'll probably need to set up internal endpoints on each worker role, and in your WCF service, divide up the request among the enumerated worker role instances, and then sending a direct message to each instance with its specific assignment.

David Makogon
Thanks. It's the second case. So it's possible for the WCF service to control directly how many worker roles instances are created and their exact endpoints?
Peladao
If you need to be in complete control, then you can have your WCF service tweak the scaling. I'd suggest keeping that external, but that's entirely up to you.If, say, you created 3 worker role instances, you can enumerate the instances and find out what port is assigned to each instance. Then, you could implement an internal WCF service in your worker role, and have the Web Service method call individual instances, telling each what to do.
David Makogon
Great, thanks, accepted.
Peladao
If you don't need to roll your own, you this is exactly what this product does (in Azure no less) https://www.greenbutton.net/
knightpfhor
@David: Is it also possible to host the WCF service in a Worker Role (instantiated by a Web Role that only handles user log in and some basic portal functions). So the Web Role sets up a "Master" WCF Worker Role for the user. This will then divide the work to be done over a number of worker roles ("slaves"). However, the Master will from then on handle the communication with the user. I know Worker Roles can not receive external requests, but once the connection with the user has been made through the web role, can a duplex WCF connection be set up between a Worker Role and the user?
Peladao