A Method of Mediators for Building Web Interfaces of CORBA Distributed Enterprise Applications
R. Schevchenko, A. Doroshenko
Institute of Software Systems
National Academy of Sciences of Ukraine
Glushkov prosp. 40, 03187 Kiev, Ukraine
Abstract: A method of building Web mediated interface for CORBA based enterprise distributed applications is proposed. It consists in adding an extra software layer to conventional 3-tiered architecture to realize HTTP to CORBA requests transformation. A time cost model developed by authors for CORBA distributed applications is used and gives a new insight on enhancing performance and availability of applications. A comparison with other web-based system architectures as well as an analysis of emerging changes are made.
Rapid development of computer networks, introduction of technologies Intranet and universal distribution Internet services caused essential shifts in basic paradigms for enterprise software systems design. These shifts can be described as transition from exploiting some fixed set of programs, when each of which is a workplace for performing a fixed set of functionality for some business process, to continuously developing information environment of enterprise where elements of this information framework can be repeatedly reused by different business processes in different fields of enterprise activity. This trend of further integration of information services and exploiting reusable business processes leads to development of new classes of middleware that can influence significantly user interfaces to transform this domain into a self-established software layer with the similar transparency properties as business processes have. Particularly some needs are felt in creating end-user interfaces and separation of user interfaces into yet another, presentation layer of software systems where objects of presentation might have the same properties of location invariance and semantic load as those of layer of business objects. [Mf96,SLJ94]. Among other desirable properties are seen ever growing demands on performance characteristics and easy programming interfaces of enterprise distributed applications.
CORBA (Common Object Request Broker Architecture) standard determines software architecture of distributed objects and interaction between them in heterogeneous networks [OMG99]. It gives a way of organization of the distributed computation having a number of properties attractive for a designer such as precise object model, separation of object description from its implementation and call transparency. A number of Apache [LL97] originated projects are known to integrate Web and application servers that are at the same time database independent. We follow this way by introducing mediator into Apache based HTTP server, named ModCbroker [Sh001], that is integrated with CORBA application server. The purpose of this paper is to describe a mediator based method for building flexible high performance distributed CORBA applications suitable for practical use in industrial-strength software. The work relies on our experience of research and development of a CORBA based enterprise distributed software system [Sh002]. We use some insights on methods of performance optimization of distributed programs in a new 4-tiered architecture for Internet based distributed applications augmented with the mediator which enhances the conventional 3-tiered by means of various methods of minimization of objects interaction time.
2 Existing techniques for Web interface of front-ends
Conventional process of building distributed software using CORBA implies interfaces of distributed system to be specified in object model of IDL language. These specifications are then transformed into definitions of chosen programming language in accordance with standard mapping of IDL into this language, (for example, there exist now standards of IDL mapping to C, C++, Java, Ada95, Cobol, Python, and others). In compliance with these definitions server and client side of program objects are implemented and from programmers point of view client's access to remote object looks the same as access to local object which respective definitions. ORB libraries provide coding and decoding of requests to remote objects and transition with IIOP protocol of those requests over the net.
Nowadays there exist many technologies for building Web interface of front-ends to distributed applications. To choose a method of integration software system with Web server is one of the main tasks that must solved while building of Internet/Intranet system. In this section we will take up main peculiarities of existing technologies and then compare with mediator based architectures.
СGI interface [CR99,DC96]. This is first method of building Web applications, born at the same time WWW was created. From technical point of view CGI interface is based on starting an external process by Web server, passing to this process request parameters via command line, environment variables and standard input. Result of request are returned from standard output of the external process. The main (and only) merit of CGI interface is its simplicity. May be as result of such simplicity this technology is still of wide usage. But it has a number of drawbacks, and among them: 1) spawning of external process on each request to web server that causes excessive expenditure of computation resources and bad scaling of resulting applications; 2) limited ability of requests interaction: each request is handled independently from all others and links between different forms and state variables must be coded via extra parameters, so structure of CGI application is naturally mapped to task only for stateless cases; 3) low level of interface specifications: CGI program must decode MIME-coded request data itself; 4) lack of integration with software environment of distributed software. So CGI interfaces can be recommended only for externally simple tasks which have no scaling requirements.
Fast-CGI [Br99]. This is extension of CGI specifications, which define C API for embedding of CGI-like modules into Web server. This method eliminates the main disadvantage of CGI – spawning of external process on each request. The reverse of the medal is the fact that WWW server and user application share the same address space, so failure of one user application can cause failure of Web server. As for other features Fast CGI is not differ from CGI.
Server Side Scripting: Neowebscript [NWS00], PHP[RG00][PHP01]. These are methods based on immersion of programming language interpreter into Web server. Instead of static web pages Web server contains page templates with scripting language sentences embedded. Efficiency of such scheme is higher than CGI but lower than using C API. This technology literally move all merits and drawbacks of script languages into appropriate area of WWW programming: easy of usage and short learning curve make them irreplaceable in case of relatively small projects. This technique is recommended in cases of problems which can be solved by few pages. For large systems traditional limitations of scripting languages begin to tell on. Yet another drawback of this technique is low level of integration with computation environment – usually for script languages only database interfaces can be imported from external world.
Using Web server API. All widespread Web servers provide C API which allow developers to insert generation of web pages into server plugins. [Cl98] Advantages of this method consists in efficiency and ability of fine integration of WWW server with computational environment. Drawbacks are low level of programming interface, locking to WWW server platform and some deterioration of reliability (for reasons, the same as in Fast-CGI CASE). This technique is recommended to use only in cases when there exist strict requirements of productivity (for example – passing video information).
JSP [HC98][Ch97]. JSP – is the open standard which defines high-level model of Web process request handling inside of so-called Java Servlet Engine. It's one of the most developed methods of web interface building. Only disadvantages are locking to Java language and work of virtual Java machine in one address space with Web server.
Using of specialized Web servers managing server-side scripting engine which import CORBA API. This direction appeared not so long ago and now is considered to be one of priority directions for standardization by W3 consortium. The best known implementations are ILU/NG [JSJ98], and CorbaScript [MGG97]. Merits of such systems are flexibility and natural integration with Web frameworks. Drawbacks are relative complexity of tuning and programming. Also such systems are based on dynamic interface invocation (DII), which cause low productivity
Using of specialized Web servers which exports CORBA API. ModCbroker-based systems belong to this class of software. Note that we avoid using of DII by fixing CORBA API for requests processing, so performance problems of previous methods is eliminated. A fee is decreasing of flexibility and necessity of direct programming Web interfaces.
Database integrated application servers. (Examples are Oracle Application Server [BNJ98] and Sybase Jaguar [Sy99]). Many suppliers of databases begin to provide their own mechanisms for integration database data into Web. In most cases this is a combination of procedural extension of SQL and tools for embedding data views into web pages. The advantages of the technology is easy integration with databases and existence of RAD tools. From other side, ability of integration with other software is limited and cost is usually expensive. So, this tools can be recommended in cases when a customer uses principle “all from one hand” and future development of system does not envisage connection of Web application with other data sources.
Use of client-side Java applets now is not in wide use as technique of building generic Web applications. This is caused by relative inefficiency of 3-tiered architecture in low speed networks and lack of standardized Java environment in browsers as consequence of competitive activity between Microsoft and Sun.. But this technique can be successfully used in special cases where browser environment is controlled and information passing can be efficiently organized with a help of apriori knowledge of data domain. One of areas where such technique can be successful is using applets with combination of server engine for representation of geographical information.
3. Cost Model for Object Interaction
General prerequisites of CORBA object requests
broker interactions where GIOP (General InterORB Protocol) is a protocol for
between brokers [OMG99]. This architecture establishes following limitations on client-server interactions:
· interaction establishes permanent connection between the server and client while request processing;
· method invocation is synchronous, that is once client's thread has executed remote method invocation it is blocked until of the reply; asynchronous computation can be founded on existence of another (parallel) thread communicating a server thread by means of synchronous method invocation;
· implementation of the remote method may require sending some context needed for correct execution of the method;
· stages of request processing and their order are predefined.
Our analysis of time costs of request brokers shows that performance of a broker is mainly dependent on following functions underlying stages of request processing.
1. Marshalling (demarshalling) function M(x) (Dm(x)) which implement coding (decoding) stages in request x processing. These functions are almost additive in space, M(x|y)=M(x)|M(y)|pad(x,y), where x|y is concatenation, pad(x,y) is a quantity of bytes aligning y after x, and almost linear in time TM(x|y)=TM(x)+TM(y)+d(x,y), where TM(x) is a time for coding x, and d(x,y) is negligible with respect to TM(x). Notice that the size of according GIOP sequence |M(x)|=KSM|x| in bytes can be considered as proportional to size of request |x| with a coefficient KSM. Time for coding and decoding are considered as nearly equal.
2. Search objects function. The main parameter this function is dependent on is amount of objects supported in the system. So time cost for invocation this function can be designated TFO(o,No), where No is a size of object table in the system.
3. Search methods function. Searches in table of methods with time cost designated as TFm(m,Nm(o)), where m is method and Nm(o) is a size of table of remote methods of the object.
4. Activation object and invocation method function, estimated on time as TI(o,m) which includes time for servant invocation and, if needed, its thread initialisation.
5. Network data transfer function. ,
where Ks is mean value for a byte transfer time.
So let there is a program code y=o.m(x) with propagating a context c, where m is the method of remote object o with input parameter x and output y. To find estimation of time cost for this basic piece of code of distributed applications we need to define a number of time cost model constituents that are characterised in terms of functions introduced above:
1) if designate req(o,m,x,c) a function of sending appropriate request for o.m(x)operation then coding request time can be estimated as
2) transferring request time:
3) decoding request time:
4) time of search object in active object map, object activation, method invocation and evaluation of request:
5) time for reply transfer:
6) time for reply decoding :
Summarising these time estimations, we can deduce the following timing cost model of CORBA remote method invocation Ty=o.m(x) as:
4. Basics and features of mediator based architecture
The essence of suggested mediator based architecture is to exploit CORBA architecture for business logic layer and to use Web based architecture for presentation layer. Interaction scheme of software layer for systems build up with such a HTTP/CORBA mediator looks as follow:
So mediator provides CORBA API for handling of users requests from one side and acts as Web server for HTTP requests handling from other side. Our implementation of such generic mediator component is ModCbroker developed by GradSoft (Kiev, Ukraine) [Sh001].
What differs Intranet and Internet applications is the cost of network data transfer –10-100Mbs for LAN and 1-10 Kbs. for Internet: Thus a good design of Internet application implies minimisation of network data transfer time TS, while for Intranet application the time of invocation TI can be more critical. One of consequence for making decisions in architecture design is to insert additional software layer for collecting data passed in large pieces of information in order to speed up integral performance of Internet application: Such Internet case architecture with four layers (Database, Logic, Server Front-End, Client) can be more efficient than traditional 3-tiered one consisting of Database, Server and Clients.
Suppose that for collecting data in a single chunk it is needed to process N requests with method invocations of approximately equal time complexity. So for standard 3-tiered architecture we have following assessment of time evaluation:
Now consider the extra layer of logic where we have heterogeneous medium with transfer factor for external medium (Internet) and internal (LAN) as K1 and K+1 respectively. If WWW Servlet executes all invocations in LAN environment collecting all needed parameters with additional information and sending it to remote browser in a single chunk. then we obtain:
where is a size of additional information added by servlet and is an overhead due to servlet invocation. The difference will be:
Considering that and the difference is of three orders of magnitude we can conclude LAN expenses is usually negligible in respect to the time of network transfer. So the benefit T –T* is surely can be significant if the size of additional data is not enormous |z| < (|x|+|y|)*N and if time of operation is determined mostly by time of network data transfer.
Work of ModCBroker as any other application server engine is to translate incoming http requests to CORBA IIOP requests and provide to application developer programming interface (API) for input of http requests parameters and output of results to WWW browser of end-user. ModCBroker is the Apache module and is aimed at efficient building Web interfaces of CORBA based applications. Its mission is transparent translation of HTTP queries to requests to CORBA servers by means of conventional NameService without bindings to local computer. In bird's-eye view process of building WWW application with help of ModCbroker can be described by following steps:
Detailed API description with examples of usage can be found in [Sh001].
Main features of developed HTTP/CORBA mediators consist in following. First, installation of mediator on chosen Web servers makes them fully transparent and callable by name. This means independence of service from its location and needs just registering servlets in common namespace in accordance with standard scheme of building CORBA applications. Adding or removing web servers and changes of external configurations of our system does not violate functionality of servlets. Second, program complex obtains property of independence from physical interface, and we receive possibility to use component design principles. That is we have standard interfaces of presentation of different entities glued with each other via HTML references and interface components can be reused without tedious procedure of re-arrangement of application. And third, a paradigm of building complex as set of standard components can extended to building of user interfaces. As a remarkable example we can note component of report generator build as interface of general kind between UAKGQuery[Sh01,SD01] and ModCbroker.
Also important is possibility of automatic adaptation of conventional WWW techniques of load distribution, fault tolerance and caching to CORBA-based distributed applications. Indeed method of load distribution on Web servers consists in providing multiple DNS records for each of Web servers set with IP addresses laying in different areas of routing. This allows fault tolerant work of Web server during breakdown of one of communication links, on one side, and distribution of workload –on the other one. Applying this technique to mediator based systems we automatically receive fault-tolerance property relative to fail of one of communication channels. Load balancing can not be achieved directly in this way if all mediators refers to the same servlet, but combining this approach with standard CORBA methods of load-balancing [OMG01, OMG00] we can receive sought result.
Methods of request acceleration known as reverse caching consist in placing few caching proxy servers before actual WWW servers. For case of Web application, not just static web pages, this method can be applied only for read-only requests of slowly changed data (such as dictionaries or OLAP timestamp based data). It is interesting that this method of acceleration is similar to “memoizing” optimization well-known in functional programming. Note that non-caching reverse proxies can be used for load-balancing.
Yet another feature of Web interface is a reducing cost of users education as they work with already familiar web interface. Of course, technique of using Web interfaces have not only merits but also some known shortcomings: low interactiveness and high computational workload on server side.
Costs for security systems support in conventional 3-tiered architecture is also significantly higher because transferring information through non-protected channel like Internet imply transferring communication commands for subsystems of lower level such as databases. So in this case it is needed either to protect the whole traffic of application by encryption of transport level commands (what is very expensive) or to embed into protocols some security subsystems what complicates design process.
So we come to decision to use mediator based solutions in geographically distributed systems and Internet. For local networks it is better to use combined approach and apply traditional model for the cases: when high interactiveness of user interface is required, when complex graphical images must be built for each client, and when intensive computation on limited set of data must be performed for each client session. Note that in case of low speed communication channels such as Internet interactiveness of mediator based application can be higher than interactiveness of traditional client-server architectures as time of response of Web application in low speed channels appeared to be less than that of traditional client-server application. This fact is causes by difference between data transfer speed in Intranet and Internet: for LAN we usually have 10-100Mb/c, for WAN – 1-100Kb/c. Meidator can be used as collector for LAN messages: it receive request from WAN, then form presentation layer, doing sequence of Intranet calls, then pass data to remote Internet client in one big chunk. The more formal mathematical model, based on analysing of physical processes can be found in [Sh002, SD01]. This justifies the fact why non-fast Java first broadly used at client side in mediated 4-tiered architectures now is being exploited mostly at server side.
From our point of view the main value of ModCbroker architecture is not just technical details of possible performance increasing, but in reflecting of general evolution of enterprise information systems from set of applications driven by information flow of fixed business processes to set of services not bound to specific business processes, but applicable to wide set of use-cases in specific business domain and driven by general business rules, not processes. Other examples of such evolution are using directory service in HR and CRM software and using enterprise-wide access control service. Web presentation service is just next step in this process. Existence of flexible server-side web presentation service in open framework of software components will fill gap between speed of changes in today-s business environments and speed of development process for custom solutions.
HTTP/CORBA mediators architecture are deployed in few ModCbrocker based software systems, some of them are in production during more than a year. During this time some bottleneck of this model became visible, some directions to enlarge functionality are understood. Some problems of current implementation and ways to it’s solving can be described as follows.
1. Low level of HTML handling. Servlet passes to client’s browser low-level code on HTML language. In large projects it is preferable to have some API for interaction with client based on semantics entities. This problem can be solved by supplying with mod_cbrocker library of high level semantics based presentation primitives. But this library must provide local non-CORBA API for productivity reasons, so language independence would be lost.
Lack of automatic session management. Current ModCbroker API is request-oriented. So, application programmer must keep session management “by hand”. This problem also can be solved by providing specialised library.
Future workability of CORBA AMI [OMG011]. There exist possibilities for increasing ModCbroker productivity by using asynchronous processing of interaction between CORBA application server and WWW interface server. CORBA AMI (Asynchronous Message Invocation) feature, introduced in CORBA-2.4 can be used in perspective. Why not now - AMI is yet not supported in most object request brokers available in today’s market. Note that in spite of evident inefficiency of current model of execution in all real applications deployed by now system productivity was not limited by speed of mediator execution.
So we show that technique of building Web front-ends to software systems using CORBA/HTTP mediators can be useful and efficient for Intranet and Internet based environments. We have intention to develop a client library to provide high level session based model for web interfaces.
Note that our implementation of ModCbroker is available for free download in source form from site http://www.gradsoft.kiev.ua with documentation package and license, which allow use of ModCbroker without fee for non-commercial purpose.
[BNJ98] B.D. Brown, R.J. Niemiec, and J.C. Trezzo, Oracle Application Server Web Toolkit Reference, 1998, ISBN: 0-07-882433-8, 924 p.
[Br99] Mark R. Brown, FastCGI Specification, Open Market, Inc. Apr. 1999 http://www.fastcgi.com
[Ch97] Phil Inje Chang, An Overview of Java Web Server 1.0, Java Servlets, and the JavaServer Architecture, Sun Microsystems, Inc, August 1997.
[Cl98] Nancy Winnick Cluts, ASP from A to Z, Microsoft Corporation, 1998
[CR99] Ken A L Coar, IBM Corporation, D.R.T. Robinson E*TRADE UK Ltd, The WWW Common Gateway Interface Version 1.1 , Internet Draft, http://Web.Golux.Com/coar/cgi/draft-coar-cgi-v11-03-clean.html 1999
[DC96] John December; Mark Ginsburg, HTML & CGI Unleashed, Professional Reference Edition, Sams Macmillan, 1996. ISBN-1575211777
[HC98] J. Hunter, W. Crawford, Java™ Servlet Programming. O’Reilly, First edition, published October 1998, ISBN 1-56592-391-XE, 526 p.
[JSJ98] Bill Janssen, Mike Spreitzer, Dan Larner , Chris Jacobi ILU 2.0beta1 Reference Manual, Xerox Corporation
[LL97] Ben Laurie and Peter Laurie, "Apache. The Definitive Guide", O'Reilly, 1997, ISBN 1-56592-250-6
[Mf96] M. Fowler. “ Analysis Patterns and Business Objects”. OOPSLA’96, 1996.
[MGG97] Philippe Merle, Christophe Gransart and Jean-Marc Geib. Using and Implementing CORBA Objects with CorbaScript, OBPDC'97 Object Based Parallel and Distributed Computing, Toulouse, France, October 1997.
[NWS00] NeoWebScript™ Tutorials: ver. 3.2 NeoSoft, 2000. http://www.neosoft.com/neowebscript/ index.html
[OMG00] OMG. Trading Object Service, version 1.0 Object Management Group. 2000. formal/2000-06-27
[OMG01] OMG. Fault Tolerance. Object Management Group. 2000. orbos/2000-01-01
[OMG011] Object Management Group, Inc. CORBA Messaging. 2001 formal/01-02-58
[OMG99] OMG, "The Common Object Request Broker: Architecture & Specification", "Object Management Group", 1999, formal/99-10-07
[PHP01] www.php.net official PHP site.
[RG00] Tobias Ratschiller and Till Gerken, Web Application Development with PHP 4.0. New Riders Publishing, July 2000, ISBN 0-7357-0997-1, 384 pages
[SD01] R. Shevchenko, A. Doroshenko, Techniques for Increasing Performance of CORBA Parallel Distributed Applications, Proc. Int. Conf. “Parallel Computing Technologies”, 2001, (to appear).
[Sh002] R. Shevchenko, Analysis of Efficiency Enhancing Methods of CORBA Based Distributed Applications, Proc. 2-nd Int. Conf. on Programming, May 23-26, 2000, Kiev, Ukraine, pp. 226-240 (in Russian).