If you'd like to know more what an Enterprise Service Bus and Service Oriented Architecture as understood by the Zato project should look like, this is the great place to start.
The ability to output HTML comes in particularly handy when there's a need to create a quick dashboard for a Zato solution yet running another deamon to serve HTML is not practical.
The service exposes one method generate_payload which expectes you to provide a set of business data and a Django template to render the data in.
Here's a sample client service using the base one to output a list of customers ...
Naturally, there's nothing preventing you with serving or linking to Twitter Bootstrap, jQuery or any other tool to make the result as attractive as possible.
If you're looking for more straight-to-the-point information on how an Enterprise Service Bus and Service Oriented Architecture should look like, Zato project is the place to learn about it.
Enjoy the read and again, many thanks to Alex!
It's a middleware cache for exchange rates data fetched using Yahoo! YQL's XML. It's meant to support hypothetical, yet practical, scenarios of storing backend data in a cache close to a frontend application. The client frontend is not included in the repository because Zato is an ESB and backend application server, not a frontend one.
The code can form part of a wider process of building analytical applications that need convenient access to aggregated data.
Splitting the functionality across multiple applications means higher reusability - Zato provides caching, API and data while frontend systems - no matter what technology they are written with - can focus on their own job of providing interesting and useful user interfaces.
WHAT IT SUPPORTS AND DOES
- Querying for an average exchange rate for a given date
- Registering pairs of currency codes to periodically grab rates for (i.e. USD and EUR)
- Deleting existing pairs
- Listing all existing pairs
- Periodically updating the cache with newest values read using YQL's XML response
- Periodically trimming the cache so it doesn't grow indefinitely
All that is contained within a single Python module hot-deployed on servers running in a cluster behind a high-availability load-balancer.
The installation documentation includes exposing two of the services over HTTP and JSON, so once everything is installed ...
... curl can be used to register a couple of pairs and querying for their current exchange rate.
Services hot-deployed on one server in a cluster are automatically installed on other servers.
There are several services involved and each can be independently exposed over multiple access channels though the installation steps show only create-exchange-pair and get-rate.
update-cache and trim-cache modify the contents of the cache with a Redis-based distributed lock held. This is needed because each service may be possibly running in multiple copies on more than one server so there must be a way to ensure that each one has access to consistent data only - no partial updates must be visible.
dispatch-update-cache is a wrapper service which uses self.invoke_async to asynchronously invoke a separate instance of update-cache which actually updates the cache. Each instance may be running on different server and the load is spread automatically by Zato.
The solution developed can invoked from any frontend application using any programming language but for Python applications, Zato offers a Python client which allows one to communicate with Zato using regular Python dictionaries, as below
InfoQ have just published a Chinese translation of the original article (in English) that introduces all the major aspects of Zato - architecture, clusters, servers, load-balancer along with a sample financial integration with Yahoo/YQL and Google XML, GUI screenshots, CLI and an overview of all the user-visible features.
This is a straight-to-the-point read for team leaders, systems architects and developers.
Thanks to 马德奎 for the translation!