2007/10/10

Open Source JDBC Proxy Drivers


JDBC drivers that are act as proxies for other JDBC drivers is quite an interesting design pattern (i.e. Decorator). It has many elements of an AOP interception based strategy albeit against a ubiquitious and standardized interface. Here's a list of open source projects that have exploited this design pattern. It'll be an interesting exercise to re-implement many of this into reusable aspects.




  1. P6Spy - P6Spy is an open source framework for applications to intercept and optionally modify database statements. The P6Spy distribution includes P6Log, which intercepts and logs the database statements of any application that uses JDBC. This application is particularly useful for developers to monitor the SQL statements produced by EJB servers, enabling the developer to write code that achieves maximum efficiency on the server. P6Spy is designed to be installed in minutes and requires no code changes.


  2. C-JDBC - C-JDBC provides a flexible architecture that allows you to achieve scalability, high availability and failover with your database tiers. C-JDBC instantiates the concept of RAIDb : Redundant Array of Inexpensive Databases. The database is distributed and replicated among several nodes and C-JDBC load balance the queries between these nodes. C-JDBC allows to build any cluster configuration including mixing heterogeneous databases. The main features provided by C-JDBC are performance scalability, fault tolerance and high availability. Additional features such as monitoring, logging, SQL requests caching can be provided as well. The architecture is widely open to allow anyone to plug custom requests schedulers, load balancers, connection managers, caching policies, etc.



  3. SSL-SQL-Proxy Server - The goal was to develop a server, that works as a proxy server, to forward SQL-Queries using SSL. The server was supposed to be mostly platform independent, and after some considerations, Java was the language of choice. The proxy-server accepts SSL-secured connections over TCP/IP, and reads the request using a specified protocol. Then the proxy-server uses a JDBC-Driver to connect to the database and forward the query, getting the result and transfer the result back to the client via SSL.


  4. Virtual JDBC - VJDBC is a vendor-agnostic type 3 JDBC-Driver with which you can remotely access every JDBC-Database in an efficient manner. Due to its command-oriented design different networking protocols can be supported quite easily. There is a similar open source project called RmiJdbc. The main difference between VJDBC and RmiJdbc is that RmiJdbc exposes the complete interface of the JDBC-Objects via RMI, so every call on an JDBC-Object will go over the network. VJDBC uses a different approach with command objects and a very thin remote interface.


  5. Proxool - Transparently adds connection pooling to your existing JDBC driver. You can monitor the performance of your database connections and listen to connection events.




  6. LDBC - LDBC (Liberty DataBase Connectivity) is a JDBC driver that provides vendor-independent database access. With LDBC, your application will just work on all major databases and you don't have to change any source code. LDBC is based on ANSI-SQL and JDBC. LDBC radically simplifies porting of existing or new applications to new databases. The main components of LDBC are a JDBC driver and a SQL grammar converter. LDBC completely shields the application from database vendor specific code. Included SQL grammar and JDBC API documentation.


  7. HA-JDBC - High-Availability JDBC. HA-JDBC is a JDBC driver implementation that provides light-weight, transparent clustering capability to groups of homogeneous JDBC-accessed databases. In contrast with the C-JDBC project, HA-JDBC does not limit the functionality of the underlying JDBC drivers and supports many JDBC 3.0 features.


  8. PFJDBC - A wrapper over any JDBC driver, it corrects some of the common mistakes the programmers do during the development process and also provides SQL execution timing information. Hints for: cache, AUTOCOMMIT, ISO LEVEL, performance reports for TX,STMTS, etc.


  9. Backpedal - Backpedal is a JDBC driver that can be messaged to roll back all SQL statements issued through it. It is intended to be used in testing scenarios, to allow you return the database to the state it was in before your test case started.


  10. jxdbc - A JDBC proxy driver for JXTA.


  11. Microsoft JDBC Driver Proxy - Tired of the Microsoft JDBC Driver running slowly and failing on Object and NVARCHAR fields? Proxy the Microsoft JDBC driver to run Faster and Better!


  12. c3p0 - c3p0 is an easy-to-use library for augmenting traditional (DriverManager-based) JDBC drivers with JNDI-bindable DataSources, including DataSources that implement Connection and Statement Pooling, as described by the jdbc3 spec and jdbc2 standard extensions. Not really a proxy but uses byte code injection to acomplish its deed. Apparently, the Hibernate folks love this project.


  13. Daffodil Replicator - Daffodil Replicator synchronizes databases by transfer and merging of changed data. It allows bi-directional synchronization with heterogeneous enterprise databases supporting JDBC drivers and key features such as triggers, procedures and auto increment columns. Its flexible publish and subscribe model has been tested with Oracle, SQL-Sever, PostgreSQL, Derby and Daffodil DB.


  14. Primrose - Primrose is a database connection pool. Current containers support are Tomcat 4 & 5, Resin 3 and JBoss 3 and a
    standalone version used for applications not running inside a container.
    Features include optional notification of crisis events, SQL statement monitoring for connections, starting/stopping pools without application restarts, adding / removing connections on the fly, a web interface for pool management, queueing of connection requests during heavy load, statistics for types of SQL statements executed and executiion times and enhanced debug information for hanging connections.


  15. Sequoia - Sequoia is a transparent middleware solution for offering clustering, load balancing and failover services for any database. Sequoia is the continuation of the C-JDBC project∞. The database is distributed and replicated among several nodes and Sequoia balances the queries among these nodes. Sequoia handles node failures and provides support for checkpointing and hot recovery.


  16. Elvyx - Elvyx is a tool designed to monitor and profile the jdbc activity. This jdbc profiler has a wrapper that intercept the access to the database and send this information to the elvix server. The server receives the information, store the data into a database and serve this information to the client. The client shows sql statements, bound sql statements, elapsed time, elapsed time preparing the statements, etc.




Ping me if you know of any other interesting JDBC proxy implementations.

No comments: