Component Replication In Distributed Systems: A Case Study .

2y ago
46 Views
2 Downloads
323.14 KB
14 Pages
Last View : 2d ago
Last Download : 3m ago
Upload by : Karl Gosselin
Transcription

Component Replication in Distributed Systems: aCase study using Enterprise Java Beans‡G. Morgan‡, A. I. Kistijantoro‡, S. K. Shrivastava‡ and M.C. Little‡*School of Computing Science, Newcastle University, Newcastle upon Tyne, UK*Arjuna Technologies Ltd., Newcastle upon Tyne, UKAbstractA recent trend has seen the extension of object-oriented middleware to componentoriented middleware. A major advantage components offer over objects is that onlythe business logic of an application needs to be addressed by a programmer withsupport services required incorporated into the application at deployment time. This isachieved via components (business logic of an application), containers that hostcomponents and are responsible for providing the underlying middleware servicesrequired by components (such as persistence) and application servers that hostcontainers. Well-known examples of component middleware architectures areEnterprise Java Beans (EJBs) and the CORBA Component Model (CCM). Servicesavailable at deployment time in most component architectures are componentpersistence (typically using databases) and atomic transactions (for ensuring theconsistency of component state). This paper examines, using EJBs, how replicationfor availability can be supported by containers so that components that aretransparently using persistence and transactions can also be made highly available.Key Words: Availability, components, CORBA Component Model , Enterprise JavaBeans, fault tolerance, middleware, replication, transactionsDRAFT: 30 Dec 20021

1. IntroductionModern client-server distributed computing systems may be seen as implementationsof an N-tier architecture. In a typical four tier architecture the first tier (client tier)consists of client applications containing browsers, with the remaining three tiersdeployed within an enterprise representing the server side; the second tier (Web tier)consists of a Web server that receives client requests typically via HTTP and passeson the requests to specific applications residing in the third tier (business tier) that iscapable of hosting distributed applications; the fourth tier (enterprise informationsystems tier) contains databases and legacy applications of the enterprise. Theplatform providing the Web tier plus business tier is usually called an applicationserver.An application server typically deploys a variety of object oriented middlewareservices using an object request broker (ORB) and provides to applications a higherlevel of abstraction of component oriented middleware. It is worth examining herebriefly why this higher level of abstraction has been considered necessary. Althoughobject oriented middleware provides type checked remote invocations and standardways of using commonly required services (such as for naming, persistence,transactions, etc.), a problem still remains that application developers have to worryabout application logic as well as technically complex ways of using a collection ofservices. For example, use of transactions on distributed objects requires concurrencycontrol, persistence and the transaction services to be used in a particularly intricatemanner. Component oriented middleware alleviates this difficulty by the use ofcomponents that are composed of objects, and containers that host componentinstances. Containers take on the responsibility for using the underlying middlewareservices for communication, persistence, transactions, security and so forth and adeveloper’s task is simplified to specifying the services required by components in adeclarative manner. Thus, a major advantage components offer over objects is thatonly the business logic of an application (encoded in objects) needs to be addressedby a developer. Well-known examples of component middleware architecturesinclude Enterprise Java Beans (EJBs) and the CORBA Component Model (CCM).In this paper we investigate how software implemented fault tolerance techniques canbe applied to support component replication for high availability. We take the specificcase of EJB components and consider strict consistency (that requires that the statesof all available copies of replicas be kept mutually consistent). We take EJBsprimarily because not only they are used extensively in industry, but also becauseopen source implementations of application servers for EJBs are available forexperimentation. However, we believe that the ideas presented here are of interest tothe general case of component middleware. In particular, as EJBs are closely relatedto the language independent CCM, the ideas presented here can be applied to theworld of CORBA components.Data as well as object replication techniques have been studied extensively in theliterature, so our task is not to invent new replication techniques for components, butto investigate how existing techniques can be migrated to components. In the spirit of2

component middleware, we prefer to delegate the responsibility of replicationmanagement to the container (container managed replication). We therefore examinehow replication for availability can be supported by containers so that componentsthat are transparently using persistence and transactions can also be made highlyavailable, enabling a transaction involving EJBs to commit despite a finite number offailures involving application servers (where computations take place) and databases(where persistent data is kept).Ours is an engineering task that poses several problems that require careful resolution.In order to highlight these problems and possible solutions, we consider threereplication approaches, beginning with a simple approach into which weincrementally incorporate additional sophistication. To explain these approaches,consider a simple transaction that in a non-redundant system operates on EJBs livingwithin a single container, with the beans storing their persistent states on a database;in this system, we incorporate redundancy as follows:(i) State replication with single application server: Database is replicated; heredatabase (but not the application server) failures can be masked, so the transactionwill be able to commit provided the application server can access a copy of thedatabase.(ii) State replication with clustered application servers: Database is replicated;multiple application servers are used for load sharing the total number of transactionsin the system; an individual transaction has the same reliability features as case (i)above.(iii) State and computation replication with clustered application servers: Database isreplicated and instances of beans are replicated on the cluster of application servers;this is an ideal set of server side availability measures as it is able to mask a finitenumber of application server and database failures.We require that our solutions must be open (non-propriety) and implementable insoftware. Furthermore, we require that our solutions be transparent to the componentmiddleware. The transparency requirement imposes the following constraints on oursolutions: (a) no modifications to the API (Application Programming Interface)between client and component; (b) no modifications to the API between an EJB andthe container; and (c) no modifications to the existing middleware services and APIs.Given these constraints, the contributions of the paper are to show that approaches (i)and (ii) can be implemented with relative ease, but it is not possible to implementapproach (iii) without breaking constraint (c); we outline what enhancements wouldbe necessary to the component middleware to support approach (iii).The paper is structured as follows: background information on EJB componentmiddleware is presented is section 2; replication approaches are then discussed insection three; related work is presented in section four, with concluding remarks insection five.3

2. EJBs and Application ServersThe specification of Java 2, Enterprise Edition (J2EE) defines a platform fordeveloping Web-enabled applications using Java Server Pages (JSPs), Servlets andEJBs. Application servers for Java components (also called J2EE servers) areexpected to provide a complete implementations of J2EE. In the first two sub-sectionswe describe the terminology and basic concepts of J2EE middleware that should besufficient for our purposes (for additional details, see [1]). The third sub-sectiondescribes availability measures currently provided in application servers.2.1. EJBsThree types of EJBs have been specified in J2EE: (1) Entity beans represent andmanipulate persistent data of an application, providing an object-oriented view of adata that is frequently stored in relational databases. (2) Session beans on the otherhand do not use persistent data, and are instantiated on a per-client basis with aninstance of a session bean available for use by only one client. A session bean may bestateless (does not maintain conversational state) or stateful (maintains conversationalstate). Conversational state is needed to share state information across multiplerequests from a client. (3) Message driven beans provide asynchronous processing byacting as message listeners for Java Messaging Service (JMS). Every session (entity)bean has a component interface that defines the business methods callable by theclients, and a home interface that defines the methods for the client to create, remove,and find EJB components of the same type. All client to (entity, session) beancommunications is normally achieved via the Java Remote Method Invocation (RMI).In this paper we will be concerned with session and entity beans only. Availabilityconsiderations for message driven beans will also need to consider those of JMS, andthis is regarded a topic in its own right.Information describing the appropriate system services required and how they are tobe applied to an EJB is specified by a developer within a deployment descriptor. Acontainer is responsible for hosting components and ensuring that middlewareservices are made available to components at run time as described in deploymentdescriptors of components. Containers mediate all client/component interactions. Acontainer vendor achieves this by providing automatic code generation tools that willproduce the appropriate mechanisms that integrate a component successfully into acontainer.An entity bean can either manage its state explicitly on a persistent store (beanmanaged persistence) or delegate it to the container (container managed persistence).All EJB types may participate in transactions. Like persistence, two approaches areavailable: Container managed: The deployment descriptor is used to specify thetransactional qualities associated with the EJB on a per-method basis. A developerdoes not have to identify transactional boundaries (e.g., begin, commit) in anenterprise bean’s code. The container sets the boundaries of a transaction,beginning a transaction immediately before an enterprise bean method starts andcommits a transaction just before a method exits.4

Bean managed: A developer explicitly specifies transactional boundaries withinthe code of an enterprise bean.Use of container managed persistence and transactions is strongly recommended forentity beans. Below we describe how this particular combination works, as we willbe assuming this combination for our replication schemes.2.2 Transactional EJB applicationsThe main elements required for supporting transactional EJB applications deployed inan application server are shown in figure 1. An application server usually manages afew containers, with each container hosting many (hundreds of) EJBs; only onecontainer with three EJBs is shown in the figure. The application server is a multithreaded application that runs in a single process (supported by single Java VirtualMachine). Of the many middleware services provided by an application server to itscontainers, we explicitly show just the transaction service. A transaction manager ishosted by the application server and assumes responsibility for enabling transactionalaccess to EJBs. The transaction manager does not necessarily have to reside in thesame address space as the application server, however, this is frequently the case inpractical systems. At least one resource manager (persistence store) is required tomaintain persistent state of the entity beans supported by the application server; weshow two in the figure. In particular, we have shown relation database managementsystems (RDBMS) as our resource managers (bean X stores its state on RDMSA andbean Y does the same on RDMSB). We assume that resource managers support ACIDtransactions (ACID: Atomicity, Consistency, Isolation, Durability).Application ServerClientinvocationcontainerEntity XSessionJDBCARDBMSAXAAEntity YJDBCBRDBMSBXABTransactionManagerFigure 1 – Elements involved in EJB transactions.Communications between an RDBMS and a container is via a Java DataBaseConnectivity (JDBC) driver, referred in the J2EE specification as a resource adaptor.A JDBC driver is primarily used for accessing relational databases via SQLstatements. To enable a resource manager to participate in transactions originated inEJBs, a further interface is required. In J2EE architecture this interface is referred toas the XAResource interface (shown as XA in figure 1). A separation of concernsbetween transaction management via XAResource interface and resource managerread/write operations via JDBC is clearly defined. In simple terms, the transactionmanager interoperates with the resource manager via the XAResource interface andthe application interoperates with the resource manager via the JDBC driver.We now describe, with the aid of figure 1, a sample scenario of a single transactioninvolving three enterprise beans and two resource managers. A session bean receives5

a client invocation. The receiving of the client invocation results in the session beanstarting a transaction, say T1, and issuing a number of invocations on two entitybeans (X and Y). When entity beans are required by the session bean, first the sessionbean will have to ‘activate’ these beans via their home interfaces, which results in thecontainer - we are assuming container managed persistence - retrieving their statesfrom the appropriate resource managers for initialising the instance variables of X andY. The container is responsible for passing the ‘transaction context’ of T1 to theJDBC drivers in all its interactions, which in turn ensure that the resource managersare kept informed of transaction starts and ends. In particular: (i) retrieving thepersistent state of X (Y) from RDMSA (RDMSB) at the start of T1 will lead to thatresource manager write locking the resource (the persistent state, stored as a row in atable); this prevents other transactions from accessing the resource until T1 ends(commits or rolls back); and (ii) XA resources (XAA and XAB) ‘register’ themselveswith the transaction manager, so that they can take part in two-phase commit.Once the session bean has indicated that T1 is at an end, the transaction managerattempts to carry out two phase commit to ensure all participants either commit orrollback T1. In our example, the transaction manager will poll RDBMSA andRDBMSB (via XAA and XAB respectively) to ask if they are ready to commit. If aRDBMSA or RDBMSB cannot commit, they inform the transaction manager and rollback their own part of the transaction. If the transaction manager receives a positivereply from RDBMSA and RDBMSB it informs all participants to commit thetransaction and the modified states of X and Y become the new persistent states.In our example, all the beans are in the same container. Support for distributedtransactions involving beans in multiple containers (on possibly distinct applicationservers) is straightforward if the transaction manager is built atop a CORBAtransaction service (Java Transaction Service), since such a service can coordinateboth local and remote XA resources. Such a transaction manager will also be able tocoordinate a transaction that is started within a client and spans EJBs, provided theclient is CORBA enabled. For this reason, in the rest of the paper, we need onlyconsider the simple case of a transaction, that, in a non redundant system, spans EJBswithin a single container and a few resource managers.2.3. Availability measures in current application serversCommercial application servers make use of multiple applications servers deployedover a cluster of machines with some specialist router hardware (see below) to maskserver failures and rely on propriety replication mechanisms of database vendors fordatabase availability (for example, some Oracle database products support a specificreplication scheme). As we discuss below, these availability measures do not integrateproperly with EJB initiated transactions.Application servers are typically deployed over a cluster of machines. A locallydistributed cluster of machines (a set of machines) with the illusion of a single IPaddress and capable of working together to host a Web site provides a practical wayof scaling up processing power and sharing load at a given site. Commerciallyavailable application server clusters rely on a specially designed gateway router todistribute the load using a mechanism known as network address translation (NAT).6

The mechanism operates by editing the IP headers of packets so as to change thedestination address before the IP to host address translation is performed. Similarly,return packets are edited to change their source IP address. Such translations can beperformed on a per session basis so that all IP packets corresponding to a particularsession are consistently redirected. Load distribution can also be performed using aprocess group communication system as first suggested by the ISIS system [2]; arecent open source application server has such a mechanism [3]. The two marketleaders in the application server space, WebSphere [4] from IBM and WebLogic [5]from BEA, have very similar approaches to clustering. They typically characteriseclustering for: Scalability: The proposed configuration should allow the overall system to servicea higher client load than that provided by the simple basic single machineconfiguration. Ideally, it should be possible to service any given load, simply byadding the appropriate number of machines. Load-balancing: The proposed configurations should ensure that each machine orserver in the configuration processes a fair share of the overall client load that isbeing processed by the system as a whole. Furthermore, if the total load changesover time, the system should adapt itself to maintain this load-balancing property. Failover: If any one machine or server in the system were to fail for any reason,the system should continue to operate with the remaining servers. The loadbalancing property should ensure that the client load gets redistributed to theremaining servers, each of which will henceforth process a proportionatelyslightly higher percentage of the total load. Transparent failover (failures aremasked from a client, who minimally might need to retransmit the currentrequest) is an ideal, but rarely achievable with the current technology, for thereasons to be outline below. However, the important thing in current systems isthat forward progress is possible eventually and in less time than would be thecase if only a single machine were used.Transparent failover is easy to achieve for stateless sessions: any server in the clustercan service any request and if a client makes multiple requests in succession eachmay well be serviced by a different server. Failover support in this case is trivial: if afailure of the server occurs while it is doing work for the client then the client will getan exceptional response and will have to retransmit the request. The situation is morecomplicated for a stateful session, where the same server instance must be used forrequests from the client, so the s

1 Component Replication in Distributed Systems: a Case study using Enterprise Java Beans G. Morgan‡, A. I. Kistijantoro‡, S. K. Shrivastava‡ and M.C. Little‡* ‡School of Computing Science, Newcastle University, Newcastle upon Tyne, UK *Arjuna Technologies Ltd., Newcastle upon Tyne, UK Abstract A recent trend has seen

Related Documents:

All types of data replication . SQL Server DBA Alphabroder Co Philadelphia PA. After-Image (Log based) Replication All types of data replication OpenEdge Replication Pro2 Replication Custom Replication. . [server] control-agents sportsagent1 database sports transition manual

steps in replication cycle Viruses depend on host cell machinery to complete replication cycle and must commandeer that machinery to successfully replicate Viral Replication: Basic Concepts Replication cycle produces-Functional RNA’s and proteins-Genomic RNA or DNA and structur

DNA replication DNA replication occurs at distinct cis-acting elements of DNA. Such origins of replication are used to nucleate the duplication of the genome. Two replication forks are generated at each origin and DNA replication occurs in a semi-conservative manner

DNA replication begins at a specific site called origins of replication. A eukaryotic chromosome may have hundreds or even a few thousand replication origins. Proteins that start DNA replication attach to the DNA and separate the two strands, creating a replication bubble. At each end of the replication

- vSphere Replication - SPBM configured as part of replication - vCenter Site Recovery Manager - SRM configuration based on VR replication vSphere Replication & vCenter SRM - Asynchronous replication - 15 minute RPO - VM-Centric based protection - Provide automated DR operation & orchestration

Types of replication schemes 1-7 Active standby pair with read-only subscribers 1-7 Classic replication 1-9 . Replicating an AWT cache group with a subscriber propagating to an Oracle database 1-17 Replicating a read-only cache group 1-17 Sequences and replication 1-18 Foreign keys and replication 1-19 Aging and replication 1-19 iii.

Distributed Database Design Distributed Directory/Catalogue Mgmt Distributed Query Processing and Optimization Distributed Transaction Mgmt -Distributed Concurreny Control -Distributed Deadlock Mgmt -Distributed Recovery Mgmt influences query processing directory management distributed DB design reliability (log) concurrency control (lock)

control DNA replication in C. elegans, as well as their functions in particular stages of development and specific cell types. Several techniques used for analysis of DNA replication in C. elegans are summarized in BOX 1. 3. The factors that regulate DNA replication The regulation of DNA replication in