The P2P Model

The SOA provides a powerful framework for building next-generation applications. However, for some enterprises, the centralized hub-and-spoke structure of the SOA is too inflexible. Some enterprises want to build web service solutions that require real-time views of work in progress, inventories, logistics, etc. Other businesses want to exploit highly successful peer-to-peer (P2P) applications, such as instant messaging and content distribution.

The P2P approach differs from the SOA in that no attempt is made to define explicit roles. Any node, or peer, can operate in any role it knows about or can discover through other peers on the P2P network. We often think that this “be whatever you can discover” capability makes the P2P model more suitable for doing web services than the SOA.

Despite its legal problems, looking at an application such as Napster (or its close relative, Gnutella) from a web services perspective is useful. Users publish the files they are willing to share and these files are listed in a registry. (Napster had a centralized database that served as a registry and Gnutella has a distributed searching mechanism, which is essentially a virtual registry.) Other users can search the registry (physical or virtual) and download files directly from the provider. This process maps nicely onto the SOA, except that there’s no clear distinction between provider and requestor or even (in the case of Gnutella) requestor and directory. Peers establish ad hoc, short-term ...

Get Java Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.