DCSIMG
Workflow in the Cloud - Manu Cohen-Yashar's Blog

Manu Cohen-Yashar's Blog

Workflow in the Cloud

One of the major missing parts in windows azure was the support for workflow. You could install a workflow on a web role but when multiple instances of the web role try to persist and load the same workflow instance an exception is thrown. Workflow was designed to run by a single host that persist its state to a single database. This concept does not fit to the cloud that uses multiple computing instances by design.

Azure AppFabric provides the solution. A whole new host was developed especially for the cloud. We as developers do not have to deal with the host yet we should know what happens under the cover, what is supported and what is not.

AppFabric released a CTP-1 in June 2011. This is only the first release of this new workflow engine. A lot has to be done. Many features are missing and Microsoft is waiting for feedback.

Persistence

I think that major concept that was changed concerns persistence and tracking. Unlike on-premises deployments we do not have to supply a database to persist and track the workflow. Persistence is done inside the service bus and not in SQL. The idea is that the host instance has to be stateless as possible. All messages to hosts running workflow services are sent through service bus. With a message (to a receive activity in a particular workflow instance) service bus attach all the workflow instance state required to continue and run the workflow. Unlike on-premises deployments the hosts do not own the workflow instance, they just run it according to the information they get from service bus.

clip_image002[4]

Tracking

Tracking is not supported currently but another new interesting feature does the job.

All workflow services expose a special endpoint called IWorkflowManagement . Clients can create a reference to this endpoint and get query interesting information about the workflow such as its status or the name of the bookmark it is waiting on. Concerning status it is possible to write additional custom information with a new activity called SetUserStatus. I cannot claim that IWorkflowManagement substitute tracking services (Microsoft says that tracking will be supported in the future) but it provides answer for many use cases we implemented with tracking in the past. It is simple and easy.

 

Workflow to workflow communication

When crating a reference from one "service" to another in AppFabric composite application Visual studio generates code to create a proxy. In workflow Visual studio simple generates a custom activity that can be used to call another workflow.

 

Transactions

Distributed transactions are not supported in the cloud. There is just no Distributed transactions coordinator. It means that all the transaction activities we use on-premises will just not work in the cloud. 

Summary

AppFabric provides the ability to run and manage workflow in the cloud in massive scale.

We are now in CTP-1 a lot has to be done, but we can see where we are going and it looks great.

I recommend watching the session about workflow in AppFabric-TV

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: