XML technologies / XML / Python & XML / Python and distributed systems design / Sample application and flow analysis
(Excerpt from “Python & XML” by Christopher A. Jones & Fred L. Drake, Jr.)
We will build a large sample application to illustrate many different concepts and show how they can be used together. An intelligent XML switch, which knows how to route XML code to the right destination, lies at the center of the distributed application. We also explain how these switches can be connected in a daisy-chain network to form scalable networks of XML data. Components connected to the switch include a user-input application, an SQL database of customer profiles, and an XML information repository. The following figure shows a diagram of the application.
Figure: The distributed sample application
The application demonstrates how several different applications, possibly with different purposes, can use the same XML traffic on the network. Its success depends on how XML code moves between applications while remaining decoupled from them. Viewed from above, the application appears to its end users as a portal website. Backend systems of various kinds are integrated by exposing XML messaging APIs, enabling the portal to operate. Other applications connect around the periphery of the main data processing to participate in the flow of XML information.
Decoupling application systems
Consider, for example, the Web/CGI application on the right of the figure above. Normally it connects directly to a database containing the information it needs. In this scenario, however, the XML switch decouples the database from the Web/CGI application. The Web/CGI application merely sends an XML packet (in this section, a SOAP-like packet) requesting relevant data. The switch interprets the packet and routes it to the right destination (in this particular case, a Python object capable of doing the required work). When the database responds, the information returns to the original caller. This allows flexibility in database location and design. Distributed systems can thus rely on XML interfaces when exposing their functionality, rather than dealing with table-design issues or the names of particular stored procedures (stored procedures).
Routing provides flexibility
This design resembles message-queuing systems architecturally, although there are some subtle and important differences. Decoupling different parts of an enterprise lets you share their functionality more widely and enjoy independence from any particular application processing the data. Introducing an intermediary between data sources and consumers also allows business logic to exist at a level above and between applications instead of having to be programmed directly into them. In the figure above, for example, imagine outsourcing the profile database and instead using an Internet service from a third party that holds customer data. If you find a web service offering better personalization and customer data than your own, you can connect to it, develop an XML interface suited to your network, and exchange the old database for the new service provider. Local applications consuming the information would be none the wiser: the XML switch would still accept their XML requests and results would still be routed back to them.
Routing provides scalability
In addition to component flexibility, this routing increases system scalability. By routing XML requests for information through your network, you gain the ability to manage them as you would other kinds of network traffic. For example, you can replace individual systems with pools of several servers and balance the load caused by the XML packets sent between them. Alternatively, XML switches can be connected in a daisy-chain network, much as routers and hubs are chained together for TCP/IP traffic. This concept lets you use techniques such as broadcasting and duplication of read-only signals. It also permits redundancy and multiple network paths to the same destination.
Copyright © 2002 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “Python & XML” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de