FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
SOA Web Services Blog: SOA, Intermediation, and Long Running Transactions
XML & Web Services
<![CDATA[[

Web Services and Smart Data.

by John Dorsey
THE SOFTWARE SIMPLIST

Web Services Wisdom.

by Udi Dahan
July 22, 2007

SOA, Intermediation, and Long Running Transactions

In Nick Malik's follow up post The value of intermediation, part 2, he describes "composable services" as follows:

I would suggest that a service, when composable, (a) provides information in a manner that can be readily reused without requiring multiple calls to other services for interpretation, and/or (b) provides functionality that can be executed to produce specific semantics in an encapsulated manner without requiring references to multiple other services and without unknown or undesirable side effects.

I woud state that a service that does not comply with the above "suggestions" is not a service in the SOA sense. I don't care much for the "composable" or "reusable" qualifiers that are being placed on the term "service". I believe that it creates fractured definitions that don't improve understanding.

Nick continues with assertions about the connection between SOA and Canonical Data Models:

I argue, passionately, that a service that does not leverage a Canonical data model (explicit or implicit) is not useful outside a small handful of very specific situations. Such a limited service provides some small benefits, but probably not more than a COM+ component would, and certainly not enough to justify all this interest in SOA. We get no business agility from this kind of service. Therefore, as an Enterprise Architect, you can create it, but I will not use it, nor will I look kindly on another application that does. Poor integration is just barely a half step up from no integration. Some would argue it is a step down.

Just to be clear, a Canonical Data Model is something that exists without dependence on any service. That is why I don't agree with its use in SOA. Each service has its own message schema which makes use of its own data schema if you will. A data schema is the definition of structures that are used in more than one message type. The service controlls both of these schemas and decides when and how to version them, which versions to support on which endpoints, etc. It's all part of the service's autonomy. I'm not quite sure what an implicit canonical data model is.

I'm also unclear as to the "benefit" a service provides. Services are the way we model our business domain - they are therefore a part of our business. In my previous post on intermediation and SOA I gave an example of a Purchasing Service. This service does not really exist to provide something external to it with a "benefit", it's an inherent part of the structure of the business, much like the Purchasing Department of the company is. It participates in business processes but is not ruled by them. I really don't see how you could compare that to any kind of technological component. In that respect, you don't "use" a service. Neither do you really "integrate" them. Each service decides which processes it needs to be a part of, simply by choosing which events (of the EDA kind) it subscribes to. This leads to a kind of "distributed integration" that maintains service autonomy and has no single point of versioning or failure.

One of the comments quoted includes the statement "Intermediation greatly complicates any message exchange pattern other than request-response and pub-sub". Like I described in my previous post, intermediation, if it even does occur, occurs behind service boundaries. Between services, you have the basic message exchange patterns of duplex request/response (one way messaging each time, with correlation between them) and pub/sub. You really don't need anything else, and yesterday's middleware already handled all of that for us. Most of the advanced ESB functionality isn't needed between services.

The next example given discusses a banking scenario (well, more of an HR one really), which brings Nick to the following conclusion:

This process is neither pub-sub nor request-response. It is a long-running orchestration with compensating events. The process is NOT complicated by the ability to intermediate.

In fact, I would argue that nearly all valuable long running transactions MUST have the ability to intermediate in order to allow them to be composed, and recomposed, and orchestrated.

Long running anything, is a series of message exchanges that are tied together in some way. This could be as simple as having all the messages contain the same process ID in their body. "Compensating events" are just the result of business logic being run in a service, possibly changing its own state (updating those backend systems and applications), and sending out other messages. If there's any intermediation of the kind Nick describes, it occurs within a service between its backend systems and applications. He also implicitly states that there is value in composing/orchestrating these "long running transactions", apparently without having the service be involved. I don't see it. Not the way I do my services. Once again, each service is responsible for itself - its part of the global "long running transaction", ie business process. If one service were to choose to implement its cross-application workflows in a hard-coded manner, that should have no impact on any other services, nor should they be aware of it. That service may have been implemented poorly and as a result have difficulty responding to changing business conditions quickly, but that's its own business. That implementation could easily be upgraded in the future, without changing the overall Service-Oriented Architecture.

Nick's conclusion follows:

In conclusion, I don't say that intermediation is a requirement of a service oriented architecture. But I do say that intermediation is a requirement of a service oriented architecture designed to deliver composability, and therefore, business agility.

Mine is a little different. When your SOA is made up of autonomous business-level services, you will have business agility. The implementations of some services may benefit through the use of intermediation, but it is not a top level concern.

Posted by Udi Dahan at 05:03 PM  Permalink




 
INFO-LINK