Dynamic Object Offloading in Web Services

3 downloads 99 Views 319KB Size Report
level: results produced by Web services invocations could be transferred to the .... adding components that host and run loading strategies in a transparent way ...
Dynamic Object Offloading in Web Services Quirino Zagarese, Gerardo Canfora, Eugenio Zimeo Department of Engineering University of Sannio Benevento, ITALY {quirino.zagarese, gerardo.canfora, eugenio.zimeo}@unisannio.it

Abstract—In several application contexts, Web Services adoption is limited due to performance issues. Design methods often propose the adoption of coarse-grained interfaces to reduce the number of interactions between clients and servers. This is an important design concern since marshaling and transferring small parts of complex business objects might entail sensible delays, especially in high latency networks. Nevertheless, transferring large data in coarse-grained interactions might bring useless data on the client side, whereas a small part of the transferred object is used. To reduce data transfers, in addition to well-known techniques based on XML compression, a possible approach is considering a finer granularity at data level: results produced by Web services invocations could be transferred to the client by using incremental loading. However, existing Web service technology does not provide run-time infrastructures with an adequate support for lazy serialization. In addition, pure lazy serialization could incur in high overheads due to many interactions, especially in wide area networks. This paper presents a novel approach to extend existing Web services run-time supports with dynamic offloading capabilities based on an adaptive strategy that allows servers to learn clients behaviors at runtime. By exploiting this approach, service based applications can improve their performances, as experimental results show, without any invasive change to existing Web services and clients. Keywords-web-services; performance; xml serialization; service design; adaptation

I. I NTRODUCTION While Web Services are becoming the de-facto standard for cross-platform communication in multi-organization environments, their adoption is often limited because of performance issues. These are mostly due to high latency and low bandwidth, characterizing world-wide networks, which significantly influence marshaling and transferring complex business objects. Meaningful examples of such objects can be found in the PLM (Product Life-cycle Management) area, where large data concerning structural and management aspects of products need to be shared among multiple systems [4], and in the telecommunication area, where providers sales and ordering systems expose interfaces to extract data on customers’ orders [3]. In these complex and often multiorganisational environments, design a migration strategy to embrace the SOA paradigm can be very challenging. Several approaches for SOA migration, like legacy code wrapping [6][7] and conversion of legacy components to

services [8], have been proposed in the literature. However, these approaches focused primarily on reducing migration efforts and preserving the correct behavior of systems, without addressing performance issues. Designing services interfaces in order to achieve acceptable performances remains a main challenge for service-computing diffusion. The need to minimize the overhead due to network latency, often leads to the design of coarse-grained service interfaces. However, this approach can cause unnecessary data transfers, since each service invocation implies serialization of a large XML document, even if the client needs only a small portion of such document. For example, we noticed that large objects are handled by Geospatial Web Services through coarse-grained interfaces and data buffering to avoid calls overhead. The consequence is the transfer of large data (often layered for handing different aspects of a geographic area) without considering the usefulness of all the attributes (or layers) for the specific client that issues the service invocation. Over the years, many solutions have been proposed to minimize client-server interaction time, by compressing XML documents or by incrementally loading XML structures. The latter approach seems more promising since it allows for reducing the amount of data transferred on the network by delivering to the caller only the data used by the application, whereas XML compression could still be used to further reduce the size of exchanged messages. However, the idea of incremental loading is in its infancy and current Web services technology does not yet provide tools for smart lazy-serialization of object attributes. This paper recalls some considerations presented in our preliminary work [18] and extends it by presenting a detailed view of a lightweight middleware aimed at optimizing network-based interactions for data-intensive services. Optimization is achieved by applying a technique, called Dynamic Object Offloading, that combines eager and lazy serialization of the attributes of objects resulting from services invocations. Moreover, we analyze and discuss the results obtained by running some experimental cases involving the proposed middleware implementation to outline additional improvements based on a dependency view of business objects. The remainder of the paper is organized as follows.

Section II presents the main research efforts related to this work; Section III details the proposed architecture and discusses its implementation; Section IV compares the proposed architecture to standard ones, by describing our experimental results; Section V discusses the experimental results and introduces a dependency-based representation of business objects; Section VI concludes the paper and outlines future works. II. R ELATED WORK Several proposals have been made to cope with highlatency and low-throughput networks in the SOA context. One design-based approach consists of exposing coarsegrained operations, in order to minimize the number of client-server interactions, and thus network latency related overhead. Papazoglou [15] underlines how fine-grained messages can result in high network traffic and increased difficulty for error handling. He also states that finding the best grain is not an easy task, since too coarse-grained interfaces reduce services reusability and interchangeability. A different approach aimed at reducing the amount of data exchanged between client and server is based on messages compression. This approach has been widely adopted in the past for binary protocols, in order to overcome extremely low-bandwidth characterizing dial-up connections, as well documented in reference [14]. Diffusion of textbased protocols, that have enhanced systems interoperability while worsening network usage efficiency, has relaunched the adoption of compression-based techniques. First attempts employed general text file compressors; although good compression can be achieved, this approach completely ignores the document structure so that every parse or update operation forces the uncompression of the whole document. XMill [1] is a tool for applying existing compressors to XML. It separates document structure and contents, by assigning XML tokens to different containers through a path processor that receives events from a SAX parser. Cheney [9] introduces ESAX (Encoded SAX). The approach consists of maintaining a symbol table in order to translate SAX events into binary format. Cheney also describes a technique called multiplexed hierarchical modeling, resulting from composition of text compressors and XML structure knowledge, based on Prediction by Partial Match[10]. Werner [11] proposes the concept of differential SOAP encoding. The idea is to only transmit the differences between a SOAP message and its skeleton, that is extracted from the WSDL definition of the service. Anyway, this concept does not effectively apply to messages containing complex data-types, like arrays or vectors, since the structure length is unknown when the message skeleton gets generated. Rosu [12] proposes an interesting approach, called ASOAP, based on an incremental dictionary-based compression technique. Differently from other dictionary based compression techniques, endpoints do not exchange dictionary in

advance, but they agree on a dictionary managemement policy and incrementally build dictionaries, as communication progresses. A third way to minimize exchanged data during clientserver interactions consists of serializing the results only when needed (possibly by fragmenting them in chunks and transferring these ones on demand). The approach described in [3] entails negotiating a data fragmentation strategy, using an extension to WSDL, so that endpoints can specify the actual document fragments they are going to produce and/or consume. The AXML framework [2] relieves the amount of exchanged data, by inserting service calls inside XML documents in order to enable lazy loading of XML fragments. This approach, originally aimed at facilitating integration of heterogeneous data-sources, especially for large scale contexts, actually reduces the amount of loaded fragments to the needed ones. However, pure lazy-loading introduces communication overhead due to further requests needed to retrieve useful fragments. A further approach consists of optimizing the overall amount of data exchanged among the components of a distributed application. In this direction, [13] proposes the adoption of future variables and continuations. By using this technique, the result of an invocation is propagated among requestors as a placeholder. The needed data is transferred only when a “strict” operation is performed on the placeholder, if a lazy and home-based approach is used. This technique reduces the number of copies in the overall system, but does not avoid transferring useless data to each requestor. The work presented in this paper is complementary, since it focuses on the optimization of a single interaction, by trying to transfer only the needed data. In particular, we take advantage of both coarse-grained and lazy serialization characteristics by combining them, based on data collected by profiling clients. Data compression and future variables remain orthogonal features and thus can be seamlessly applied to our work. Analogously, different text protocol formats like JSON[21] and binary formats like Hessian[22] can be combined with our proposal to further improve performance. III. M IDDLEWARE ARCHITECTURE AND IMPLEMENTATION

Most systems that expose functions through web-services communicate with other systems through an inherently eager-loading approach: every time a new request is received, a result is computed, serialized to the network, and unserialized on the client side. A different approach consists of adopting a lazy-loading strategy. In such case, for each incoming request, a result is computed as well, but XML fragments get serialized to the client as soon as they are needed.

As we have extensively shown in [18], if we assume that all attributes in an object Obj exhibit the same size S, then we can state that a performance gain, in terms of time (Tretrieve ) needed to load a useful portion of Obj, is achieved if: Naccess