Re: Messaging is the Right Way to Build a Distributed System
Posted: Aug 1, 2005 12:50 PM
> When using Jini, you can use PreferredClassLoaders so code
> that is downloaded to the machine is the most current
> version, even though it can also handle the old version.
> So technically the old side can be upgraded......
I wasn't aware of that. Thanks for the update.
>> The lack of transparency makes things harder to debug.
>> You can't see what's going back and forth unless
>> you're in an interactive debugger, or write a special
>> logging tool.
> Surely this is just some form of Wire Tap or Detour, that
> can be implemented as a Message Endpoint, before
> forwarding on to the intended recipient, unless you are
> referring to actually peeking at the message on the
> message queues.
Right. Actually seeing the message in a debugger, or with println debugging. Composing test messages. Logging them. Patching a bad message to continue testing. All possible with ASCII messaging, and all but the last of which are possible without additional implementation steps.
> I have no particular issue with the idea that messaging is
> as good a way (although as a previous poster pointed out,
> they both have their pros and cons) as RPC for doing
> distributed systems.
It's tempting to agree with that statement in principle. But it has been difficult to find a good "pro" argument for RPC. If co-located, RPC isn't needed. If distributed, messaging seems superior. We assume there must be some sort of middle-ground use case where RPC is ideal, but have yet to identify it.
That use case may involve breaking an existing application into distributed modules. In such circumstances, an RPC wrapper might make the migration go more quickly--until such time as the app can be retrofitted to use messaging instead.
> For instance, with serialization, your marshalled object
> is compared against the class definition, before you can
> get to it, in other words the byte-stream is implicitly
> verified, and of course you can have multiple versions,
> either by careful changes via non-serialization-breaking
> changes to your class format, through readExternal, or
> other mechanisms.
Interesting point. It's true, in theory at least. In practice, getting serialization to work properly has tended to be a bit of a hurdle. When you add versioning to that...
> However, with XML, if you have an XML Schema (S1)
> ...and you have 'evolved' version of that schema (S1.1),
> ...the > existing schema must be updated
Damn good point, actually. Wish to heck I'd thought of it earlier. I've been assuming non-verified XML, which is silly. Still, it's pretty easy to dispatch to a wrapper that parses the old version and delegates to the new code with appropriate defaults. Unless you're using Jini, that's hard to do with an RPC implementation. (Thanks to you, I knew to add that last sentence. :_)
> The only advantage in this is that with XML you can turn
> off implicit validation and verification of the XML
> stream, and do selective data validation and string-object
> transform, in your SAX/DOM handling, as part of your
> message recipient code.
Another design option. A good one to have in your bag of tricks.
> The thing about XML is that you have multi-platform
> interoperability....as long as you have an XML parser on
> that platform of course!
That's another great point. That was the "interoperability" feature mentioned at http://www.artima.com/forums/flat.jsp?forum=106&thread=120669#Interoperability