Sunday, October 26, 2008

[Arch] SEDA Model and scalable enterprise applications

Scalability, Performance, Fault Tolerance are classical non functional requirements when building enterprise applications. Setting up the application in a clustered environment is a very popular approach and is often used in practice.

When building process based applications you usually deal with long and short running processes. For example a order process may take one week, whereas a save transaction is a process that takes (should take) only few seconds. Short running processs often implements the backend business logic. In Service Oriented Architectures these short running processes results in a orchestration of provided services from different systems.

Mihai Lucian describes in his article a simple scenario, where different platforms in a backend process are connected by using web service endpoints. One of the platform that is queried has a slow response time. He describes one solution approach to battle to the slow response time by using asynchronous IO in servlet container and the Staged Event Driven Architecture (SEDA) model.

He mentioned that current servlet APIs do not provide methods in order to deliver data to the client in a asynchronous way. AJAX based frameworks currently use one of the modes: Polling, Piggy back and Comet. Apache Tomcat for example provides a implementation to handle asynchronous IO by decouple the requirest and response from the worker thread. So you can prepare your response later.

Now the combination with the SEDA model is very interesting, because you can route your request to the right queue. As Mule is based one the SEDA model, Mihai Lucian illustrates how to implement such a scenario in Mule (see image).




From my point of view the example is very interesting based on the following key points:
  • Asynchronous communication in a servlet container
  • The most interesting thing is how to correlate the request with the response through different layers
  • How Mule fits in such a architecture
  • Practical example of JMS
  • Using Routers in Mule and route the message to the right Queue
  • Using Apache CXF in Mule
A full description of the example is provided on the article homepage. At the end of the article he provides some benchmarks in order to provide a clear view of the advanateges using such an architecture.

1 comment:

Ilango said...

I loved this article and the one on ServerSide.
Do you have a sample application based on the concepts described in the article?
Thanks
ilango