World Wide Webber


My Books
REST in Practice: Hypermedia and Systems Architecture
Amazon:
US, UK
Developing Enterprise Web Services by Sandeep Chatterjee and Jim Webber
Amazon:
US, UK,
Also available: Korean Edition

My Bookshelf
RESTful Web Services Cookbook by Subbu Allamaraju
Programming Clojure by Stuart Halloway
RESTful Web Services by Leonard Richardson and Sam Ruby
Nobody Likes MEST :-)
Posted: 02 February 2005 @ 03:43 UT from Sydney, Australia

Savas, Chris, Jacek have a side-threadgoing about MEST and message-passing (ignore the pub/sub thing, that's a different matter). What's been most interesting about these threads have been the comments they've attracted. There are two themes which these comments are strung out along: that message-passing and procedure calls are equivalent; and that ProcessMessage is too low-level. Both of these are inaccurate and unhelpful:

Message-passing is the same thing as procedure calls.
Certainly most distributed computing platforms (including older Web Services platforms) have abstracted away the passing of messages across the network and the associated marshalling/unmarshalling of message content into parameters for procedure calls, on the understanding that such abstraction is useful since it hides a whole bunch of boring and error-prone stuff away from the developer. We've gotten away with this because our distributed applications to-date haven't been really large scale. If you've a fast, reliable, low latency network then you can get away with making remote objects look like local objects because they pretty much are. Now OK, we all know from Waldo et al's seminal paper that we probably shouldn't do this, but it works so we do.

This house of cards collapses when we start thinking about applications that span arbitrary domains. The networks are latent, messages get lost, transmission speed is variable, and asynchronous delivery of messages is normal. What, for instance, should happen when a message gets lost somewhere on the Internet? Does my RPC stub dutifully sit and wait, perhaps timing out later? What if the remote service that I'm interacting with crashes - how does my RPC facade tell me that and let me sort things out gracefully? It doesn't - RPC is a terrible metaphor for larger-than-intranet scale distributed computing. And don't get me going on "you can throw a MessageLostException..."

The fact of the matter is that a service implementation can only be resilient to such failures if it is developed specifically to deal with them. RPC sweeps everything under the rug, and leaves us believing that WS-InsertYourFlavourOfReliableMessagingHere will smooth out the lumps (it will usually, but eventually something will happen which it can't deal with, and we're back to square one - services that aren't tolerant of their deployment environment). Focussing on messages rather than procedure calls is a fine way to conceptualise and build services which are able to deal with the truth on the wire. The truth is ugly, messy, tempremental, and a pain - but it must be dealt with not ignored.

ProcessMessage is too Low-Level
The MEST architectural style advocates dealing with the truth on the wire by promoting messages to be first-class citizens in the architecture, and in the implementation. Service implementations don't use stubs to "invoke" other services, they use programmatic representations of messages as their communication mechanism (see this PowerPoint presentation for more details). This approach yields a bunch of good stuff:

  • A degree of decoupling from its consumers since as long as the right messages go up and down its stack everything is fine - there's no need to even worry about what's going on outside of the service boundaries;
  • Services are made robust since the truth has to be dealt with explicitly by developers who are dealing directly with the sending and receiving of messages - messages aren't hidden in stubs and skeletons anymore, the SOAP processing model is embraced by service implementations.
Certainly there's a trade-off here. To work at a lower level of abstraction (at least in the absence of tools which can automate this pattern), is harder work. To think in terms of message exchanges and partial failures and all the other nasty gotchas of distributed computing, and to design solutions which are graceful in their presence is also hard. But isn't this effort worthwhile?
To paraphrase, "You want loose-coupling? Well loose-coupling costs, and here's where you start paying - in code."
Comments:
#
Hi Jim. Maybe you can show me where in that discussion you reference you see the idea that message passing is the same as RPC? You're right, in that they aren't the same thing. You're wrong in that RPC abstracts away from message-passing: it's an entirely different architectural style! You're also right in that application code needs to be aware of the distributed nature of it's invocations. That's where enterprise middlewares such as COM+, DCE, CORBA and (grudingly) J2EE come in. TPMs have been doing this for decades as well, though that's a more narrow field of development. None of these systems (with the possible exception of J2EE, but I'm not that familiar with it) may distribution entirely transparent - they force me to think about it as I assumble my components. I've worked with message-passing systems that do precisely the same thing. What's the difference between sending a one-way message using UDP and having to code a "wait for ack" at the application level, and instead hiding this by some suitable sendMessageAndWaitForAck operation that does it all for me and I can reuse it? I think your understanding of stubs and skeletons and what abstractions to present to developers leaves a lot to be desired. The fact of the matter is that 40 years ago people were do distributed computing at a very low level as you describe, but not because they wanted to, simply because they had to. Over the years abstractions have built up to isolate users from some of the things that they don't have to deal with, things that can be dealt with quite nicely at the lower levels. Now, it's right in that some of these abstractions are not suitable for all situations, and distribution transparency goes too far in these cases. But then you should use something else. I don't see MEST/ProcessMessage as some grand unifying principle for Web Services. I agree with the central idea, but that idea has been around for decades. It could just as easily be collapsed into a single sentence: "think of the message; be one with the message" rather than trying to spin it as something else.
#
Brian, as I said in my posts, no one is arguing that the ideas are new. It was the same with REST. People were doing resource-orientation for some time. The Web was already in place. Still, the architectural description came later. The same here. People have been doing service-orientation for some time, message-orientation has been around too but there hasn't been a description in architectural terms (connectors, data, communication channels, etc.). As i said in my posts, MEST is not only about ProcessMessage. It talks about other things too but always through the composition of messages. As for your "sendMessageAndWaitForAck" example, in service-orientation you wouldn't do it like an RPC call. You'd express a quality of service requirement (reliable delivery) and you'd let a composable protocol take care of that. The architecture of your application would still be created in terms of one-way messages or more complicated message exchange patterns.
#
I think part of the problem explaining MEST is that "ProcessMessage" doesn't take a message as an argument, it takes a document as an argument. The message is the document plus the ProcessMessage semantic (plus the destination address, plus any other required protocol metadata). That's why I previously suggested (http://www.markbaker.ca/2002/09/Blog/2004/05/18#2004-05-processThis-followup) that it should be renamed "ProcessDocument", to drive home exactly this point. Now you're running into the same issue explaining MEST as I had explaining REST! It's transport vs. transfer all over again. Heh.
#
Mark, In our world view, ProcessMessage takes SOAPMessage as an argument, not a document. We're with you on the transfer versus transport thing, and you're right we're getting hammered on it. One difference between REST and MEST is that SOAP is our transfer protocol in MEST and everything else (even HTTP) is considered a transport.
#
Savas, I obviously didn't put enough information into my description of sendMessageAndWaitForAck, so here goes: when using one-way messages, no application that cares about message delivery is going to just send a message into the ether and forget about it. If that were the case, I could build the fastest possible message-passing system by tunnelling all messages to /dev/null. No, what happens in reality is that something somewhere needs to know whether that message got through to the intended recipient. Now, one way of doing this would be for the far side to send an ack. (This could be done by an intermediary if we put WS-RM in the way, but even the I'd want an ack from the WS-RM component that took charge of my initial message). Alternatively, I could do this lazily and wait until I'd sent a few messages and get an ack for them all. That's the sliding window protocol approach (TCP/IP uses this, for instance). Another option is to fire this all up to the application level and ensure that any subsequent message (B) that I send that does depend on the first message (A) causes the endpoint to check that it received A before doing B. The disadvantage with this of course is that it's recursive and eventually I need something to tie up all the loose ends (messages), unless I fall back into the "don't care camp". (Of course if the receiving endpoint sends an application message back to me then that could piggyback acks on it, but that message could get lost too.) None of what I have said is affected by whether this is an SOA deployment, or a distributed object system. It's all purely message-oriented and applicable wherever we use messages. So this isn't RPC specific. My point then is that this is something that maybe I'd like to encapsulate within a wrapper function/helper class, since it's something I'm probably going to want to do time and again. Oh, and before I forget: this is still all in terms of one-way messages (even the ack is a one-way, after all). I'd love to know where else you think this sort of thing happens. This "compsable protocol" you mention; what is it? I dispute the fact that there's no architectural description of MOMs. If I get a chance I'll dig out a few references. I'll come back to pub-sub for now simply because the latest buzz words in the Java world are around Enterprise Service Bus, which is an architectural model that has built on the previous decades of work in the area of loose coupling and uses pretty much this model. And it's *all* message oriented.
#

I would rather not tie MEST to SOAP. Could we not MEST without XML? I think we most definitely could. As to "ProcessMessage", why try to explain one style in term of the other? In MEST there is no "ProcessMessage", rather if you tried to implement MEST style communication in REST, then you would probably collapse all methods into "ProcessMessage". 

MEST is about the message. WHen a message arrives at an endpoint, it is dispatched to handlers - either selectively, or to all and let each handler decide whether or not it wants to handle the message. MEST is more basic than SOAP or WSDL in that respect.

#

Hey Udi, 

When we originally coined the term "MEST" we did so from the same kind of perspective as Fielding did when he coined "REST". We looked at the SOAP processing model (sans MEPs) and extracted what we thought were the salient architectural constraints (lifecycle, actors, etc). 

So as to whether we can do MEST without SOAP, the answer is "yes and no" since MEST is derived from the SOAP processing model. However you can take those same principles and create other explicit message-passing systems without SOAP, and (if you're sensible) without externally modelling the state of the entities that are doing the sending and receiving of messages. 

In that sense, any system which is composed from truly autonomous components with strong encapsulation is MESTful - where the only externally visible aspects of the system are the messages and message exchanges and where the components internally decide what to do with a message they have received within the context they received it. 

I think we're concurring here :-) 

Jim

#

I like MEST. I blogged about this recently (Pragmatic Web Services) and how evolving from previous proprietary MOM approaches to SOAP over JMS results in a more natural approach to SOA. 

My only criticism is that I don't think we need to term "MEST"...this is just web services done properly.

#

Hi Saul, 

Savas and I would agree with that. Back in the times when we coined the term MEST we did so to deliberately give a name to "Web Services done right." 

Jim

Trackbacks:
-
For so long now I have happily taunted Mark B. about how I love to tunnel my own favourite architectural style and application protocol over his favoured architectual style and beloved application protocol (amongst others).Now with the arrival of SCA ...
-
Since our recent IEEE Internet Computing article on SSDL, there's been renewed interest from the community in the ideas. One thing that I've found helps folks to understand SSDL is to couch it in terms of things with which they're already familiar, wh...
Author Name:
Email:
Author URL:
Comment:
Antispam:
Please type the following string (note that if the strings don't match, your comment will be lost... sorry!): 'GPEL'.
 
Recent entries

Recent comments

Feeds:
RSS 2.0 Atom