Saturday, September 18, 2010

Zero Copy pass through in WSO2 ESB

There have been some confusion on Zero Copy pass through scenario (we call that Binary Relay) implementation at WSO2 ESB. Let me try to clarify that.



To implement Binary Relay, we use Axis2 architecture. Axis2 works only with SOAPEnvelope as the input to its pipeline,  but users can add Formatters and builders against different content types. Job of a Builder is to build a SOAP envelope from anything (e.g. HTTP SOAP Message, from fast XML, from Jason message etc.) and pass it in to Axis2 pipeline, and job of a Formatter is to take a envelope and write it out in any expected form (write it as a text message, to fast XML, to Jason message etc).

To implement Binary Relay,  we wrote a builder, that takes the input stream and and hides it inside a fake SOAP message without reading it, and wrote a formatter that takes the input stream and writes it directly to a output stream. (of course, we take a small buffer and use that to move data between two streams).

Now if you want to understand how it works, best way is to look at the code.

When you look at the code, it is important to note following. Pass through works only if no one access the content of the message. However, there are many cases where user wants to cache (e.g. logging or any other intermediate use), and we detect that and handles it. If you look at BinaryRelayBuilder.java, you will see that we create a DataHandler, hides the input stream inside the DataHandler, and passes it in. To understand how we stream the data, you should look StreamingOnRequestDataSource.java. There, if that is the last use, we just take the input stream and stream it.

If you just look at BinaryRelayBuilder.java, readAllFromInputSteam(..) method can be misleading, and the real code that does the streaming is at StreamingOnRequestDataSource.java. We do cache. But that is ONLY IF something tried  to access the SOAP body, and if nothing reads the SOAP body, it is zero copy, as we pass over the input stream as it is to next code.

Sunday, September 12, 2010

WSO2 Con Tomorrow

First WSO2 Con will be starting tomorrow, and to make things better, this is also our 5th year celebration. Refer to Sanjiva's blog to find out more about the topic. There is lot to say, but I am going to put that off for later. Let me just say that in my opinion, what we have done so far is nothing compared to the potential of next five years to come.

I will be doing a session on Doing Enterprise Business with Processes and Rules, and the abstract of the talk is given below.

Business logic describes how a business functions and how it would react to the different conditions arise within the organizations and market. They are typically carefully developed and refined, and often holds the competitive advantage of an organization. Ability to keep track and change the business logic in response to changing conditions is an invaluable assert to any agile organizations. In this talk, Srinath Perera presents Business Processes and Business Rules, which are two alternative approaches to represent and manage business logic instead of embedding them within programming logic and discuss when each of these three modes should be used within the enterprise.

Friday, July 23, 2010

Multi-Tenant SOA Middleware for Cloud Computing

Following are the slides for my talk on WSO2 carbon multi-tenancy architecture at Cloud 2010, two weeks back. The paper describes the WSO2 Statos multi-tenancy Architecture .

Multi-Tenant SOA Middleware for Cloud Computing


The full paper can be found here. The citation of the paper is given below.
Afkham Azeez, Srinath Perera, Dimuthu Gamage, Ruwan Linton,  Prabath Siriwardana, Dimuthu Leelaratne, Sanjiva Weerawarana, Paul Fremantle, "Multi-Tenant SOA Middleware for Cloud Computing" 3rd International Conference on Cloud Computing, Florida, 2010.
Abstract
Enterprise IT infrastructure incurs many costs ranging from hardware costs and software  licenses/maintenance costs to the costs of monitoring, managing, and maintaining IT infrastructure. The recent advent of cloud computing offers some tangible prospects of reducing some of those costs; however, abstractions provided by cloud computing are often inadequate to provide major cost savings across the IT infrastructure life-cycle. Multi-tenancy, which allows a single application to emulate multiple application instances, has been proposed as a solution to this problem. By sharing one application across many tenants, multi-tenancy attempts to replace many small application instances with one or few large instances thus bringing down the overall cost of IT infrastructure. In this paper, we present an architecture for achieving multi-tenancy at the SOA level, which enables users to run their services and other SOA artifacts in a multi-tenant SOA framework as well as provides an environment to build multi-tenant applications. We discuss architecture, design decisions, and problems encountered, together with potential solutions when applicable. Primary contributions of this paper are motivating multitenancy, and the design and implementation of a multitenant SOA platform which allows users to run their current applications in a multi-tenant environment with minimal or no modifications.

Tuesday, July 13, 2010

Towards Improved Data Dissemination of Publish-Subscribe Systems

Last week I presented the paper Towards Improved Data Dissemination of Publish-Subscribe Systems at ICWS 2010. It is based on work done with Rmaith and Dinesh on improving WS-Messenger from Indiana as a part of Open Grid Computing Environment Project.

Abstract: with the proliferation of internet technologies, publish/subscribe systems have gained wide usage as a middleware. However for this model, catering large number of publishers and subscribers while retaining acceptable performance is still a challenge. Therefore, this paper presents two parallelization strategies to improve message delivery of such systems. Furthermore, we discuss other techniques which can be adopted to increase the performance of the middleware. Finally, we conclude with an empirical study, which establishes the comparative merit of those two parallelization strategies in contrast to serial implementations.

Mainly it discusses how to implement parallel message delivery in a Pub/Sub broker while keeping the partial order of events. Slides are given below.

Wednesday, June 9, 2010

Amazon and 11 nines

Amazon has claimed 11 nines on Availability . It is very very hard feast to accomplish, and if they have done it (I would love to know how they decided on that number), that is a ground breaking achievement.

To see why, lets see what it means. Availability is measured as MTTR (Mean time to Recovery)/ MTTF (Mean time to Failure) as a percentage. In other words, it is time to recover after a failure, divided by mean time for such a failure happen. Reliability is measured in terms of number of nines in availability. So Amazon S3 will be fail for a second only for every 10^9 seconds, or 10^9/(360*24*60*60) = 32 years!!

On their seminal paper "High Availability Computer Systems", Jim Gary and Daniel Siewiorek defined availability classes, as follows

unmanaged 90.% - 50,000 mins/year downtime
managed 99.% - 5,000 mins/year downtime
well-managed 99.9% - 500 mins/year downtime
fault-tolerant 99.99% - 50 mins/year downtime
high-availability 99.999% - 5 mins/year downtime
very-high-availability 99.9999% - .5 mins/year downtime
ultra-availability 99.99999% - .05 mins/year downtime

As you will notice even they defined only 7 nines. So we do not have a name to call what Amazon has claimed.


Tuesday, June 1, 2010

WSO2 Stratos Services Released

WSO2 Stratos, which offers WSO2 SOA platform as a service, is now live, up and running. Stratos opens up a new deployment choice for our servers, by enabling them have their servers as a Service. For example, if a user need a Governance Registry, he had to either run it real hardware, run it through a Virtual Machine, or run it through Cloud. Now, there is a forth option: that is get it as a service through WSO2 Stratos. Of course there is much more to Stratos, see http://wso2.com/cloud/stratos/ and The Six Weeks and 12 People Magic for some more details.

You can find it from https://cloud.wso2.com/., and you can try it for free.