Wednesday, August 1, 2007

REST, Serendipity, and Hard Work

DevHawk found my comment on the "SOA in the Real World" book. DevHawk writes:
Yeah, I'd rather not have to think about integration before hand either. On the other hand, I want integration that actually works. It sounds like John H. is suggesting here that REST somehow eliminates the need to consider integration up front. It doesn't.
I didn't mean to imply that building RESTful system would lead to magical integration without any hard work. I can see how that came across in my post, and I guess I got the reaction I asked for ;)

Let me try again...

I want to build systems using tools, techniques, designs, and architectures that maximize my investment in effort and work to produce value. If I put one unit of effort into building something, and I get more (or many more) than one unit of value for my effort, then I'm working in a high-leverage environment.

REST uses constraints to encourage integration. If I pay the cost of building a RESTful system (uniform interface, single naming system, resource-based design, representation transfer, ...) then any other system can leverage my system - for at least some minimum degree of use. That is serendipity. This is the fundamental reason that mashups on the web can exist.

Where are the SOA mashups?

I think related to that question, DevHawk further says: aren't interested in unexpected or serendipitous reuse. They want their reuse to be systematic and predictable.
I think we disagree here. Enterprises think they want systematic and predictable systems, but I suspect this is the equivalent of developers wishing distributed object systems worked despite latency and partial failures. I'm not suggesting enterprise systems should set "not predictable" as a goal, but I do think that trying to make things too predictable often leads to fragile systems.

Disclaimer: I've only read the first chapter of the book.

Here are some more quotes.

This one leads into the first chapter:
“SOAs are like snowflakes – no two are alike.”
- David Linthicum
I'm assuming it's included not as a supporting opinion, but the first chapter doesn't do much to disprove it! Obviously if this is true then every bit of integration will have to be fought for, bit by little tiny bit. When everything is different there are no high-leverage environments for integration.

This next quote is why I don't feel (at least the first chapter) does much to discount the previous quote:
For the purposes of this book, we will define SOA as:
A loosely-coupled architecture designed to meet the business needs of the organization.
That loosely-coupled looks good. Loosely-coupled systems should be easier to integrate (as opposed to highly-coupled systems anyway).

How does an SOA become loosely-coupled? The four tenets of services or the summarized SOA process (expose, compose, consume) listed in the first chapter don't tell me anything yet.

Building systems is hard, building RESTful systems is also hard. The question of serendipity is this:
If I build an application with constraint A instead of constrain B, will I get more integration and value elsewhere the total system?
The constraints that define REST, and inspire the Web, have a significant track record for enabling integration. Are they the only constraints that can lead to value? No, absolutely not.

Can some of the constraints of REST be applied to SOA? Absolutely. I think an asynchronous, message-passing architecture with a uniform interface would be astoundingly interesting! I'm not the only one: see MEST, AMPQ, and Erlang.

1 comment:

Nick Malik said...

There is nothing in SOA that opposes REST. In fact, in a purely logical sense, REST is simply another protocol in the same message based paradigm that includes SOAP.

That said, REST has some very compelling attributes, ones that I describe in my posts on 'middle out architecture.'

To build an enterprise SOA, you need a consistent and understandable approach to identifiers, protocols and data formats. The good folks in the REST community have described simple and scalable mechanisms for the protocols and identifiers. Data formats tend to XML or JSON. (Two standards are just fine).

Mashups are very interesting and quite useful for many things. I strongly encourage them. That said, they won't solve every problem. Sometimes, you need to embed some things rather deeply, and sometimes strongly typed constraints are quite helpful.

There is room in this world for both.