one of the problems of highly distributed systems is figuring out how systems discover each other. after all, the whole point of having systems distributed is to allow flexible and perhaps even dynamic configurations to maximize system performance and availability. how do these distributed components of one system or multiple systems discover each other? and once theyre discovered how do we allow enough flexibility, such as rediscovery, to allow their fail-safe operation?
space-based programming may provide us with a good answer to these questions and more. in this article ill describe what a space is and how it can be used to mitigate some of the issues mentioned above. and ive included a technique to convert an ordinary message queue into a space.
what is a space?
conventional distributed tools rely on passing messages between processes (asynchronous communication) or invoking methods on remote objects (synchronous communication). a space is an extension of the asynchronous communication model in which two processes are not passing messages to one another. in fact, the processes are totally unaware of each other.in figure 1, process 1 places a message into the space. process 2, which has been waiting for this type of message, takes the message out of the space and processes it. based on the results, it places another message into the space. process 3, which has been waiting for this type of message, takes the message out of the space.
following are highlights of the preceding discussion:
the space may contain different types of messages. in fact, i used the term message for clarity. these messages are actually just "things" (the message may be an object, an xml document or anything else that the space allows to be put in it). in figure 1 the different shapes in the space illustrate the different types of messages.
the three processes involved have no knowledge of one another. all they know is that they put a message in a space and get a message out of the space.
as in the message-passing scenario, we arent limited to two processes communicating asynchronously, but rather any number of processes communicating via a common space. this allows the creation of loosely coupled systems that can be highly distributed and extremely flexible, and can provide high availability and dynami... 下一页