FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
SOA Web Services Blog: Space-Based Architectural Thinking
XML & Web Services
<![CDATA[[

Web Services and Smart Data.

by John Dorsey
THE SOFTWARE SIMPLIST

Web Services Wisdom.

by Udi Dahan
January 20, 2007

Space-Based Architectural Thinking

I've began rethinking certain assumptions about how I use message passing in my distributed systems after reading things like "SBA & EDA Lessons Learned" from the excellent "Panic from Fuzzy" blog. Since I was only familiar with the Tuple Space theory but have never employed space technologies like JavaSpaces, I did the only thing I could do -- I convened a session on it at the Software Architecture Workshop so as to benefit from the knowledge and experience of those frightfully smart guys. [Originally published here]

The functional issue that attracted me to spaces was its ability to do very dynamic like content-based filtering. By subscribing to notifications based on a template, I could replace a broad and deep topic hierarchy and handle some other interesting scenarios as well. For instance, when a given user is working on a certain set of data -- a tree of specific instances, I would like that machine to only get updates on that data, which could be quite a substantial savings in terms of network load. Another case is where the user is only allowed to see certain instances of the same type.

About three quarters of the way through the session, when I was still thinking that I could put entities in the space, someone called my attention to the fact that I would have to give up the cross-entity transactional semantics that I was so used to. For instance, in order to implement a business rule when an order is cancelled the customer may also need to be updated to a non-preferred status. This calls for a transactional scope around both of these updates -- on the business level. If the entities were in the space, the naïve solution would be to Take the order, change its status to cancelled, Put it back in the space, Take the customer, update its status, and Put it back in the space. By not being able to perform all this work transactionally, failure cases would need to be handled by compensating transactions -- a significant jump in complexity.

Needless to say I left that session quite a bit cooler on Space-Based Architectures than I was going in, but later on in the day, over a beer with one of the guys, he suggested that maybe spaces could be used as an alternative way to do message passing. Instead of Taking and Putting entities, we could do the same for messages -- since the business-type of transactions would by-and-large correlate to a single message. We could benefit from the dynamic subscription behavior and possibly do away with a deep, and sometimes fragile, topic hierarchy. Once again my enamourment was on the rise.

But as do all fickle loves, this too was not destined to last. After doing some more thinking I remembered about handling failure cases in terms of message passing. When dealing with reliable messages, the receipt of a message, its handling, and the subsequent sending of new messages is at times required to be all transactional. I was once again required to perform a Take operation as well as multiple Put operations in a single transaction.

I hardly believe that this is the end of the story for me and spaces. I'm still getting my head around using spaces as a technology choice in my current architectures and examining new architectural possibilities around it as well. We are definitely living in interesting times.

Posted by Udi Dahan at 04:58 PM  Permalink




 
INFO-LINK