Building Highly Available Database Applications for Apache Derby

Similar documents
Building Highly Available Database Applications with Geronimo and Derby

RAIDb: Redundant Array of Inexpensive Databases

Using Tomcat with CA Clarity PPM

Winning the J2EE Performance Game Presented to: JAVA User Group-Minnesota

RAIDb: Redundant Array of Inexpensive Databases

WebLogic Server Admin

A Comparison of Software Architectures for E-Business Applications

Configuring Apache Derby for Performance and Durability Olav Sandstå

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

Oracle WebLogic Server 11g Administration

Learn Oracle WebLogic Server 12c Administration For Middleware Administrators

Blackboard Learn TM, Release 9 Technology Architecture. John Fontaine

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

Bryan Tuft Sr. Sales Consultant Global Embedded Business Unit

Liferay Portal Performance. Benchmark Study of Liferay Portal Enterprise Edition

CHAPTER 1 - JAVA EE OVERVIEW FOR ADMINISTRATORS

This training is targeted at System Administrators and developers wanting to understand more about administering a WebLogic instance.

Qualogy M. Schildmeijer. Whitepaper Oracle Exalogic FMW Optimization

be architected pool of servers reliability and

JBoss Seam Performance and Scalability on Dell PowerEdge 1855 Blade Servers

Kony MobileFabric. Sync Windows Installation Manual - WebSphere. On-Premises. Release 6.5. Document Relevance and Accuracy

SQL Server Training Course Content

WEBLOGIC ADMINISTRATION

Proposed Solution. VoiceXML. Solution Architecture. Solution Architecture

High Availability Implementation for JD Edwards EnterpriseOne

mod_cluster A new httpd-based load balancer Brian Stansberry JBoss, a division of Red Hat

Tier Architectures. Kathleen Durant CS 3200

Dependency Free Distributed Database Caching for Web Applications and Web Services

Configuring Apache Derby for Performance and Durability Olav Sandstå

Chapter 1 - Web Server Management and Cluster Topology

JBS-102: Jboss Application Server Administration. Course Length: 4 days

HP OO 10.X - SiteScope Monitoring Templates

High Availability Technical Notice

Portable Scale-Out Benchmarks for MySQL. MySQL User Conference 2008 Robert Hodges CTO Continuent, Inc.

Cognos8 Deployment Best Practices for Performance/Scalability. Barnaby Cole Practice Lead, Technical Services

Oracle WebLogic Server 11g: Administration Essentials

Techniques for Scaling Components of Web Application

Basic TCP/IP networking knowledge of client/server concepts Basic Linux commands and desktop navigation (if don't know we will cover it )

TG Web. Technical FAQ

<Insert Picture Here> Oracle In-Memory Database Cache Overview

ActiveVOS Clustering with JBoss

Using MySQL for Big Data Advantage Integrate for Insight Sastry Vedantam

Liferay Portal s Document Library: Architectural Overview, Performance and Scalability

Oracle Weblogic. Setup, Configuration, Tuning, and Considerations. Presented by: Michael Hogan Sr. Technical Consultant at Enkitec

WSO2 Business Process Server Clustering Guide for 3.2.0

Configuration Management of Massively Scalable Systems

MagDiSoft Web Solutions Office No. 102, Bramha Majestic, NIBM Road Kondhwa, Pune Tel: /

HP NonStop JDBC Type 4 Driver Performance Tuning Guide for Version 1.0

Chapter 10: Scalability

IBM WebSphere Server Administration

Tushar Joshi Turtle Networks Ltd

Informatica Master Data Management Multi Domain Hub API: Performance and Scalability Diagnostics Checklist

New method for data replication in distributed heterogeneous database systems

XAP 10 Global HTTP Session Sharing

Active/Active DB2 Clusters for HA and Scalability

Comparing MySQL and Postgres 9.0 Replication

Performance brief for IBM WebSphere Application Server 7.0 with VMware ESX 4.0 on HP ProLiant DL380 G6 server

Solving Large-Scale Database Administration with Tungsten

ARM-BASED PERFORMANCE MONITORING FOR THE ECLIPSE PLATFORM

Course Description. Course Audience. Course Outline. Course Page - Page 1 of 5

WebSphere Server Administration Course

Tomcat Tuning. Mark Thomas April 2009

XpoLog Competitive Comparison Sheet

ELIXIR LOAD BALANCER 2

6231A - Maintaining a Microsoft SQL Server 2008 Database

Code:1Z Titre: Oracle WebLogic. Version: Demo. Server 12c Essentials.

How To Monitor A Server With Zabbix

<Insert Picture Here> WebLogic High Availability Infrastructure WebLogic Server 11gR1 Labs

Eliminate SQL Server Downtime Even for maintenance

ITG Software Engineering

Big Data Analytics - Accelerated. stream-horizon.com

Installation Guide for contineo

Weblogic Server Administration Top Ten Concepts. Mrityunjay Kant, AST Corporation Scott Brinker, College of American Pathologist

Architecture and Mode of Operation

Application Discovery Manager User s Guide vcenter Application Discovery Manager 6.2.1

Clustering a Grails Application for Scalability and Availability

Building a Reliable Messaging Infrastructure with Apache ActiveMQ

No.1 IT Online training institute from Hyderabad URL: sriramtechnologies.com

Architecting ColdFusion For Scalability And High Availability. Ryan Stewart Platform Evangelist

Clustering Versus Shared Nothing: A Case Study

Open Source DBMS CUBRID 2008 & Community Activities. Byung Joo Chung bjchung@cubrid.com

Oracle Identity Analytics Architecture. An Oracle White Paper July 2010

<Insert Picture Here> Getting Coherence: Introduction to Data Grids South Florida User Group

High Availability Solutions for the MariaDB and MySQL Database

Managing your Red Hat Enterprise Linux guests with RHN Satellite

Holistic Performance Analysis of J2EE Applications

SQL Server Administrator Introduction - 3 Days Objectives

ORACLE DATABASE 10G ENTERPRISE EDITION


Apache Tomcat. Load-balancing and Clustering. Mark Thomas, 20 November Pivotal Software, Inc. All rights reserved.

Contents Introduction... 5 Deployment Considerations... 9 Deployment Architectures... 11

Distributed Database Design

WebLogic Server 11g Administration Handbook

Transcription:

Building Highly Available Applications for Apache Emmanuel Cecchet Principal architect - Emic Networks Chief architect ObjectWeb consortium 1

Motivations tier should be scalable highly available without modifying the client application database vendor independent on commodity hardware Internet JDBC JDBC JDBC 2

Scaling the database tier Master-slave replication Cons failover time/data loss on master failure read inconsistencies scalability Web frontend App. server Master Internet 3

Scaling the database tier Atomic broadcast Cons atomic broadcast scalability no client side load balancing heavy modifications of the database engine Internet Atomic broadcast 4

Scaling the database tier SMP Cons Cost Scalability limit Web frontend App. server Internet Well-known database vendor here Well-known hardware + database vendors here 5

Scaling the database tier Shared disks Cons still expensive hardware availability Web frontend App. server Disks Internet Another well-known database vendor 6

Outline RAIDb C-JDBC and C-JDBC Scalability High availability 7

RAIDb concept Redundant Array of Inexpensive s RAIDb controller gives the view of a single database to the client balance the load on the database backends RAIDb levels offers various tradeoff of performance and fault tolerance 8

RAIDb levels RAIDb-0 partitioning no duplication and no fault tolerance at least 2 nodes SQL requests RAIDb controller table 1 table 2 & 3 table... table n-1 table n 9

RAIDb levels RAIDb-1 mirroring performance bounded by write broadcast at least 2 nodes SQL requests RAIDb controller Full DB Full DB Full DB Full DB Full DB 10

RAIDb levels RAIDb-2 partial replication at least 2 copies of each table for fault tolerance at least 3 nodes SQL requests RAIDb controller Full DB table x table y table x & y table z 11

RAIDb levels composition RAIDb-1-0 no limit to the composition deepness RAIDb-0 controller SQL requests RAIDb-1 controller RAIDb-0 controller table w table x & y table z table w table y table x & z RAIDb-0 controller table w table x table y table z 12

Outline RAIDb C-JDBC and C-JDBC Scalability High availability 13

C-JDBC overview Middleware implementing RAIDb 100% Java implementation open source (LGPL) Two components generic JDBC (C-JDBC ) C-JDBC Controller Read-one, Write all approach provides eager (strong) consistency Supports heterogeneous databases 14

architectural overview Application server DB2 C-JDBC Univ. JDBC Driver JVM C-JDBC controller with Network server JVM 15

Using C-JDBC as an open source for Application server C-JDBC JDBC JVM C-JDBC controller Embedded JVM 16

Inside the C-JDBC Controller Client application (Servlet, EJB,...) C-JDBC Client application (Servlet, EJB,...) C-JDBC Client application (Servlet, EJB,...) C-JDBC C-JDBC Controller Virtual database 1 Virtual database 2 HTTP RMI... JMX administration console Configuration Monitoring JMX Server Authentication Manager Recovery Log Request Manager Scheduler Query result cache Load balancer Authentication Manager Recovery Log Request Manager Scheduler Query result cache Load balancer dumps management Checkpointing service Backend Connection Manager JDBC Backend Connection Manager JDBC Backend Connection Manager JDBC Backend Connection Manager JDBC Backend Connection Manager Oracle JDBC Oracle 17

Virtual Backend Connection Manager JDBC Java client program (Servlet, EJB,...) C-JDBC Virtual database Authentication Manager Recovery Log Request Manager Request Cache Backend Connection Manager Scheduler Load balancer JDBC Backend Connection Manager JDBC gives the view of a single database establishes the mapping between the database name used by the application and the backend specific settings backends can be added and removed dynamically configured using an XML configuration file 18

Authentication Manager Java client program (Servlet, EJB,...) C-JDBC Virtual database Authentication Manager Recovery Log Request Manager Scheduler Request Cache Load balancer Matches real login/password used by the application with backend specific login/ password Administrator login to manage the virtual database Backend Connection Manager JDBC Backend Connection Manager JDBC Backend Connection Manager JDBC 19

Scheduler Backend Connection Manager JDBC Java client program (Servlet, EJB,...) C-JDBC Virtual database Authentication Manager Recovery Log Request Manager Request Cache Backend Connection Manager Scheduler Load balancer JDBC Backend Connection Manager JDBC Manages concurrency control Specific implementations for RAIDb 0, 1 and 2 Pass-through Optimistic and pessimistic transaction level uses the database schema that is automatically fetched from backends 20

Request cache Backend Connection Manager JDBC Java client program (Servlet, EJB,...) C-JDBC Virtual database Authentication Manager Recovery Log Request Manager Request Cache Backend Connection Manager Scheduler Load balancer JDBC Backend Connection Manager JDBC 3 optional caches tunable sizes parsing cache parse request skeleton only once INSERT INTO t VALUES (?,?,?) metadata cache column metadata fields of a request result cache caches results from SQL requests tunable consistency fine grain invalidations optimizations for findbypk requests 21

Load balancer 1/2 Backend Connection Manager JDBC Java client program (Servlet, EJB,...) C-JDBC Virtual database Authentication Manager Recovery Log Request Manager Backend Connection Manager Scheduler Request Cache Load balancer JDBC Backend Connection Manager JDBC RAIDb-0 query directed to the backend having the needed tables RAIDb-1 read executed by current thread write executed in parallel by a dedicated thread per backend result returned if one, majority or all commit if one node fails but others succeed, failing node is disabled RAIDb-2 same as RAIDb-1 except that writes are sent only to nodes owning the updated table 22

Load balancer 2/2 Backend Connection Manager Java client program (Servlet, EJB,...) C-JDBC Virtual database Authentication Manager Recovery Log Request Manager Backend Connection Manager Scheduler Request Cache Load balancer Backend Connection Manager Static load balancing policies Round-Robin (RR) Weighted Round-Robin (WRR) Least Pending Requests First (LPRF) request sent to the node that has the shortest pending request queue efficient even if backends do not have homogeneous performance JDBC JDBC JDBC 23

Connection Manager Backend Connection Manager JDBC Java client program (Servlet, EJB,...) C-JDBC Virtual database Authentication Manager Recovery Log Request Manager Request Cache Backend Connection Manager Scheduler Load balancer JDBC Backend Connection Manager JDBC C-JDBC provides transparent connection pooling Connection pooling for a backend no pooling blocking pool non-blocking pool dynamic pool Connection pools defined on a per login basis resource management per login dedicated connections for admin 24

Recovery Log Backend Connection Manager JDBC Java client program (Servlet, EJB,...) C-JDBC Virtual database Authentication Manager Recovery Log Request Manager Request Cache Backend Connection Manager Scheduler Load balancer JDBC Backend Connection Manager JDBC Checkpoints are associated with database dumps Record all updates and transaction markers since a checkpoint Used to resynchronize a database from a checkpoint JDBCRecoveryLog store log information in a database can be re-injected in a C-JDBC cluster for fault tolerance 25

Functional overview (read) connect execute SELECT login, connect password * mydb FROM t Client application (Servlet, EJB,...) C-JDBC C-JDBC Controller Virtual database 1 Authentication Manager Request Manager Client application (Servlet, EJB,...) C-JDBC Recovery Log Scheduler Query result cache Load balancer Backend Connection Manager JDBC Backend Connection Manager JDBC Backend Connection Manager JDBC 26

Functional overview (write) execute INSERT INTO t Client application (Servlet, EJB,...) C-JDBC C-JDBC Controller Virtual database 1 Authentication Manager Request Manager Client application (Servlet, EJB,...) C-JDBC Recovery Log Scheduler Query result cache Load balancer Backend Connection Manager JDBC Backend Connection Manager JDBC Backend Connection Manager JDBC 27

Failures execute INSERT INTO t Client application (Servlet, EJB,...) C-JDBC Client application (Servlet, EJB,...) C-JDBC No 2 phase-commit parallel transactions failed nodes are automatically disabled C-JDBC Controller Virtual database 1 Authentication Manager Recovery Log Request Manager Scheduler Query result cache Load balancer Backend Connection Manager JDBC Backend Connection Manager JDBC Backend Connection Manager JDBC 28

Outline RAIDb C-JDBC and C-JDBC Scalability High availability 29

Highly available web site Apache clustering L4 switch, RR-DNS, One-IP techniques, LVS, Tomcat clustering mod_jk (T4), mod_proxy/mod_rewrite (T5), session replication clustering C-JDBC RR-DNS Internet mod-jk Open source Parsing cache Result cache Metadata cache embedded 30

Result cache Cache contains a list of SQL ResultSet Policy defined by querypattern Policy 3 policies EagerCaching: variable granularities for invalidations RelaxedCaching: invalidations based on timeout NoCaching: never cached RUBiS bidding mix No cache Coherent Relaxed with 450 clients cache cache Throughput (rq/min) 3892 4184 4215 Avg response time 801 ms 284 ms 134 ms CPU load 100% 85% 20% C-JDBC CPU load - 15% 7% 31

Configuring C-JDBC as a (1/3) Client application org.objectweb.cjdbc..driver C-JDBC Driver jdbc:cjdbc://host/db C-JDBC Controller SingleDB configuration jdbc:derby:path;create=true Embedded copy c-jdbc-.jar in client application classpath Class.forName( org.objectweb.cjdbc..driver ); Connection c = DriverManager.getConnection( jdbc:cjdbc://host/db, login, password ); copy derby.jar in $CJDBC_HOME/s 32

Configuring C-JDBC as a (2/3) <?xml version="1.0" encoding="utf8"?> <!DOCTYPE C-JDBC PUBLIC "-//ObjectWeb//DTD C-JDBC 1.1//EN" > <C-JDBC> <Virtual name="xpetstore"> <AuthenticationManager> <Admin> <User username="admin" password=""/> </Admin> <VirtualUsers> <VirtualLogin vlogin="user" vpassword= x"/> </VirtualUsers> </AuthenticationManager> <Backend name="derby ="org.apache.derby.jdbc.embeddeddriver url="jdbc:derby:c:/xpetstore;create=true" connectionteststatement="values 1"> <ConnectionManager vlogin="user" rlogin="app" rpassword="app"> <VariablePoolConnectionManager initpoolsize="1" maxpoolsize="50"/> </ConnectionManager> </Backend> 33

Configuring C-JDBC as a (3/3) <RequestManager> <RequestScheduler> <SingleDBScheduler level= passthrough"/> </RequestScheduler> <RequestCache> <MetadataCache/> <ParsingCache/> <ResultCache granularity="table"/> </RequestCache> <LoadBalancer> <SingleDB/> </LoadBalancer> </RequestManager> </Virtual> </C-JDBC> 34

Highly available web site Multiple databases choosing RAIDb level recovery log for adding nodes dynamically recovering from failures Internet 35

clustering with C-JDBC Client application Client application org.objectweb.cjdbc..driver C-JDBC Driver jdbc:cjdbc://host1/db C-JDBC Controller RAIDb configuration org.objectweb.cjdbc..driver C-JDBC Driver com.ibm.db2.jcc.db2driver DB2 Universal Driver for jdbc:derby:net://host2:1527/db; create=true;retrievemessagesfro mserverongetmessage=true; Network Server org.objectweb.cjdbc..driver C-JDBC Driver jdbc:cjdbc://host3/db C-JDBC Controller SingleDB configuration jdbc:derby:path;create=true Embedded 36

Configuring C-JDBC with Network server Virtual database configuration file <Backend name= derby1 = com.ibm.db2.jcc.db2driver url= jdbc:derby:net://localhost:1527/xpetstore;create=true;retr ievemessagesfromserverongetmessage=true; connectionteststatement="values 1"> <ConnectionManager /> </Backend> 37

Configuring C-JDBC with /C-JDBC Virtual database configuration file <Backend name= derby2 = org.objectweb.cjdbc..driver url= jdbc:cjdbc://host/xpetstore connectionteststatement= values 1"> <ConnectionManager /> </Backend> 38

Configuring C-JDBC Clustering with (1/2) <RequestManager> <RequestScheduler> <RAIDb-1Scheduler level= passthrough"/> </RequestScheduler> <RequestCache> <MetadataCache/> <ParsingCache/> <ResultCache granularity="table" /> </RequestCache> <LoadBalancer> <RAIDb-1> <RAIDb-1-LeastPendingRequestFirst/> </RAIDb-1> </LoadBalancer> 39

Configuring C-JDBC Clustering with (2/2) <RecoveryLog> <JDBCRecoveryLog ="com.ibm.db2.jcc.db2driver url="jdbc:derby:net://localhost:1529/xpetstore; create=true;retrievemessagesfromserverongetmessage=true;" login="app" password="app"> <RecoveryLogTable tablename="recovery" idcolumntype="bigint NOT NULL" sqlcolumnname="sqlstmt sqlcolumntype="varchar(8192) NOT NULL extrastatementdefinition=",primary KEY (id)"/> <CheckpointTable tablename="checkpoint"/> <BackendTable tablename="backendtable"/> <DumpaTable tablename= DUMPTABLE /> </JDBCRecoveryLog> </RecoveryLog> </RequestManager> </Virtual> 40

Controller replication <Virtual name="mydb"> <Distribution/> Internet 41

Outline RAIDb C-JDBC and C-JDBC Scalability High availability 42

C-JDBC vertical scalability allows nested RAIDb levels allows tree architecture for scalable write broadcast necessary with large number of backends C-JDBC re-injected in C-JDBC controller 43

C-JDBC vertical scalability RAIDb-1-1 with C-JDBC no limit to composition deepness Client program C-JDBC JVM Client program C-JDBC JVM C-JDBC controller RAIDb-1 C-JDBC Client program C-JDBC JVM C-JDBC controller RAIDb-1 JDBC C-JDBC controller RAIDb-1 JDBC C-JDBC controller RAIDb-1 JDBC 44

Vertical scalability Addresses JVM scalability issues Distributing large number of connections on many backends Client program C-JDBC JVM Client program C-JDBC JVM C-JDBC controller Partial replication C-JDBC Client program C-JDBC JVM C-JDBC controller Full replication DB native JDBC C-JDBC controller Full replication DB native JDBC C-JDBC controller Full replication DB native JDBC DB 1 DB 2 DB 3 DB 4 DB 5 DB 6 DB7 45

TPC-W benchmark (Amazon.com) Nearly linear speedups with the shopping mix Throughput in requests per minute 1600 1400 1200 1000 800 600 400 200 0 0 2 4 6 Single Full replication Partial replication Number of nodes 46

Outline RAIDb C-JDBC and C-JDBC Scalability High availability 47

Controller replication Prevent the controller from being a single point of failure Group communication for controller synchronization C-JDBC supports multiple controllers with automatic failover Java client program C-JDBC JVM C-JDBC Controller JDBC Java client program C-JDBC JVM PostgreSQL JDBC Java client program C-JDBC JVM Java client program C-JDBC jdbc:c-jdbc://node1:25322,node2:12345/mydb JGroups JVM C-JDBC Controller PostgreSQL JDBC JDBC PostgreSQL PostgreSQL 48

Controller replication Client application (Servlet, EJB,...) Client application (Servlet, EJB,...) Client application (Servlet, EJB,...) C-JDBC jdbc:cjdbc://node1,node2/mydb Total order reliable multicast C-JDBC Controller Distributed Request Manager Virtual database 1 Authentication Manager Request Manager Scheduler Query result cache Load balancer C-JDBC C-JDBC C-JDBC Controller Distributed Request Manager Virtual database 2 Authentication Manager Request Manager Scheduler Query result cache Load balancer Backend Connection Manager Backend Connection Manager Backend Connection Manager Backend Connection Manager JDBC JDBC JDBC Oracle JDBC Emic 2005 Emmanuel Cecchet ApacheCon EU 2005 Oracle 49

Mixing horizontal & vertical scalability Client program C-JDBC JVM Client program C-JDBC JVM Client program C-JDBC JVM C-JDBC controller Full replication DB native JDBC C-JDBC C-JDBC controller Full replication C-JDBC DB 1 DB 2 C-JDBC controller Full replication DB native JDBC C-JDBC DB 3 DB 4 C-JDBC controller Full replication DB native JDBC DB 5 DB 6 DB 7 50

Building initial checkpoint Dump initial database using any tools (tar, zip, ) Initial checkpoint inserted in RecoveryLog EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM disabled dump for initial checkpoint C-JDBC Controller Recovery Log JDBC disabled 51

Logging Backend is enabled All database updates are logged (SQL statement, user, transaction, ) JDBC Recovery Log dump for initial checkpoint EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM C-JDBC Controller Recovery Log JDBC enabled enabled 52

Adding new backends 1/3 Add new backends while system online Restore dump corresponding to initial checkpoint JDBC Recovery Log dump for initial checkpoint EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM enabled C-JDBC Controller Recovery Log JDBC disabled enabled disabled 53

Adding new backends 2/3 Replay updates from the log EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM enabled JDBC Recovery Log dump for initial checkpoint C-JDBC Controller Recovery Log JDBC disabled enabled disabled 54

Adding new backends 3/3 Enable backends when done EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM enabled JDBC Recovery Log dump for initial checkpoint C-JDBC Controller Recovery Log JDBC enabled enabled enabled 55

Making new checkpoints (1/3) Disable one backend to have a coherent snapshot Mark the new checkpoint entry in the log Dump with tar/zip dump for initial checkpoint... JDBC Recovery Log dump for dump last checkpoint for last checkpoint EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM enabled C-JDBC Controller Recovery Log JDBC disabled enabled enabled 56

Making new checkpoints (2/3) Replay missing updates from log EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM enabled dump for initial checkpoint... JDBC Recovery Log dump for dump last checkpoint for for last checkpoint C-JDBC Controller Recovery Log JDBC disabled enabled enabled 57

Making new checkpoints (3/3) Re-enable backend when done dump for initial checkpoint... JDBC Recovery Log dump for dump last checkpoint for for last checkpoint EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM enabled C-JDBC Controller Recovery Log JDBC enabled enabled enabled 58

Handling failures A node fails! Automatically disabled but administrator fix needed dump for initial checkpoint... JDBC Recovery Log dump for dump last checkpoint for for last checkpoint EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM enabled C-JDBC Controller Recovery Log JDBC disabled enabled enabled 59

Recovery 1/3 Restore latest dump EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM enabled dump for initial checkpoint... JDBC Recovery Log dump for dump last checkpoint for last checkpoint C-JDBC Controller Recovery Log JDBC disabled enabled enabled 60

Recovery 2/3 Replay missing updates from log dump for initial checkpoint... JDBC Recovery Log dump for dump last checkpoint for for last checkpoint EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM enabled C-JDBC Controller Recovery Log JDBC disabled enabled enabled 61

Recovery 3/3 Re-enable backend when done dump for initial checkpoint... JDBC Recovery Log dump for dump last checkpoint for for last checkpoint EJB Container JOnAS, WebLogic, JBoss, WebSphere,... C-JDBC JVM enabled C-JDBC Controller Recovery Log JDBC enabled enabled enabled 62

Demo xpetstore/ http://xpetstore.sourceforge.net/ open source implementation of Petstore servlet version C-JDBC used as a for remote access xpetstore Servlet 63

Demo 2 xpetstore/c-jdbc/ xpetstore Servlet Recovery log embedded JMX backend1 RAIDb-1 embedded backend2 C-JDBC administration console 64

C-JDBC today Web site ~200.000 hits/month ~ 44.000 downloads Community 27 committers both industrial & academics c-jdbc@objectweb.org: ~300 subscribers, 200-300 msgs/month translation in japanese, italian, german, chinese, turkish, french RPM on JPackage.org 65

Current limitations JDBC only Distributed joins Out parameters for stored procedures Some JDBC 3.0 extensions XA support through XAPool only network partition/reconciliation not supported 66

Conclusion RAIDb RAID-like scheme for databases C-JDBC open source middleware for database replication performance scalability high availability & C-JDBC open source for high availability solution for 67

Q&A Thanks to all users and contributors... http://c-jdbc.objectweb.org 68

Bonus slides 69

HORIZONTAL SCALABILITY 70

Horizontal scalability JGroups for controller synchronization Groups messages for writes only Client 1 Client... Client n Client 1 Client... Client n Controller1 Controller1 Controller2 DB1 DB2 DB3 DB4 DB1 DB2 DB3 DB4 71

Horizontal scalability Centralized write approach issues commit commit Controller1 Controller2 Controller1 Controller2 Controller2 DB1 DB2 DB3 DB4 DB1 DB2 DB3 DB4 DB1 DB2 DB3 DB4 commit commit???? Issues with transactions assigned to connections T1(Read) T1(Write) Controller1 Controller2 Controller1 Controller2 Controller1 Controller2 DB1 DB2 DB1 DB2 DB1 DB2 T1(R) T1(W) T1(R) T2(W) 72

Horizontal scalability General case for a write query DistributedVirtual@controller1 3 multicast + 2n unicast execwriterequest(abstractwriterequest) return result DistributedRequestManager Scheduler Distributed scheduling handler Write query handler Send request to all controllers Wait for schedulers replies DistributedVirtual@controller2 DistributedRequestManager Distributed scheduling handler Distributed load balancer handler Notify scheduler of completion Scheduler Load Balancer Load Balancer Distributed load balancer handler Notify scheduler of completion Send execute request order to all controllers Wait for load balancer replies Notify controllers of completion success or not DistributedVirtual@controller3 DistributedRequestManager Distributed scheduling handler Scheduler Return result Distributed load balancer handler Load Balancer Notify scheduler of completion 73

Horizontal scalability Solution: No backend sharing 1 multicast + n unicast [+ 1 multicast] Controller1 Controller2 Controller3 DB1 DB2 DB3 DB4 DB5 DB6 DistributedVirtual@controller1 execwriterequest(abstractwriterequest) return result DistributedRequestManager Scheduler Distributed scheduling handler Write query handler Send request to all controllers DistributedVirtual@controller2 DistributedRequestManager Distributed scheduling handler Distributed load balancer handler Wait if all backends failed Scheduler Load Balancer Load Balancer Distributed load balancer handler Wait if all backends failed Wait for load balancer replies Notify controller(s) that have failed if other have succeeded DistributedVirtual@controller3 DistributedRequestManager Distributed scheduling handler Scheduler Return result Distributed load balancer handler Load Balancer Wait if all backends failed 74

Horizontal scalability Issues with JGroups resources needed by a channel instability of throughput with UDP performance scalability TCP better than UDP but unable to disable reliability on top of TCP unable to disable garbage collection ordering implementation is sub-optimal Need for a new group communication layer optimized for cluster 75

Horizontal scalability JGroups performance on UDP/FastEthernet 76

USE CASES 77

Budget High Availability High availability infrastructure on a budget Typical ecommerce setup http://www.budget-ha.com 78

OpenUSS: University Support System elearning High availability Portability Linux, HP-UX, Windows InterBase, Firebird, PostgreSQL, HypersonicSQL Enhydra server JOnAS J2EE server C-JDBC JVM Apache Enhydra Director OpenUSS OpenUSS OpenUSS OpenUSS Enhydra server JOnAS J2EE server C-JDBC JVM C-JDBC Controller Full replication Apache Enhydra Director Enhydra server JOnAS J2EE server C-JDBC JVM C-JDBC Controller Full replication Apache Enhydra Director Enhydra server JOnAS J2EE server C-JDBC JVM Firebird JDBC Firebird JDBC http://openuss.sourceforge.net Emic 2005 Firebird Emmanuel Cecchet ApacheCon EU 2005 Firebird 79

Flood alert system Disaster recovery Independent nodes synchronized with C-JDBC VPN for security issues http://floodalert.org Flood alert system Flood alert system Flood alert system JBoss J2EE server JBoss J2EE server JBoss J2EE server C-JDBC C-JDBC C-JDBC C-JDBC Controller Full replication C-JDBC Controller Full replication > 1000 miles C-JDBC Controller Full replication MySQL JDBC MySQL JDBC MySQL JDBC MySQL MySQL MySQL 80

J2EE benchmarking Internet Large scale J2EE clusters http://jmob.objectweb.org emulated users 81

PERFORMANCE 82

TPC-W Browsing mix performance 83

TPC-W Shopping mix performance 84

TPC-W Ordering mix performance 85