These are the old pages from the weblog as they were published at Cornell. Visit for up-to-date entries.

September 05, 2003

Misconceptions & state

I made a mistake in the article about web service misconceptions by including a paragraph on how distributed object systems and web service technologies both appear to enable different approaches of handling state in a distributed computation. I stated that even a most basic DO system enables state-full computing, but often could also be used for a state-less approach. WS in their minimalistic form only supports a state-less approach.

For example in a 'math' service based on distributed objects one can invoke a 'average (integer)' method on an object which each time will return the average of the arguments of all the previous average operations by taking the sum of the each of the arguments and dividing it by the number of operations. The intermediate state, the sum of all operations and number of operations, is kept in the object at the server. The client can share references to this object with other clients and each can perform operations on the object. In a web services world we are not capable of building this service. Not even if we encapsulate the intermediate state in the of the service (the sum & number of operations) in the document that is returned to the client. We cannot share this document with other clients and access the service from each of the clients and get correct global results.

To build this service with a web service we need a mechanism for storing the state and allowing the web service document to refer to it. Whether we do this using some database key or a URI doesn't matter, it can easily be done, but what we need to realize is that in its fundamental core, web services have no facility to allow a consumer to return to the same state.

Now where was I wrong in the article? By including this discussion of state at all. I had forgotten how religious the state-full versus state-less debate was and how people are still not capable of reading passed it without shouting fire! My mailbox is full with responses that show me examples of how you can build state-full web services and how to do state-less distributed objects. Although I agree with both statements, if we look at the basics of both technologies we see that both have their roots in these different approaches.

I have decided to drop that paragraph from the article. Not because it is incorrect, but because the handling it in a short concise manner is impossible given all the religious fanaticism surrounding the subject.

Posted by Werner Vogels at September 5, 2003 08:35 AM