My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

Project overview

Temporal JDBC Proxy allows to keep transactional time and history of data with a two-timestamps solutions. The proxy accepts SQL queries with temporal extensions and rewrites them into standards SQL seemingly for the supported DBMSs.

The software assumes a schema which has been temporalized. Temporalizing a schema basically means adding the needed information to keep history of data, namely the timestamps, also appends tend column to all primary keys.

This implementation is based on the Log4JDBC.

Dependencies

The Temporal JDBC Proxy uses the TSQLParser, a separate project for parsing TSQL queries.

Usage and configuration

The difference with a standard JDBC is the connection which is returned by:

Connection conn= TemporalDriverManager.getConnection(driver, username, password, schema); 

Where schema is a "temporalized" schema (see Temporalize Utility)

Note: For MySQL, you need to compile and install the now_usec() UDF (see Add-on)

  1. Compile the UDF:
gcc -fPIC -Wall -I/usr/include/mysql -shared -o now_usec.so now_usec.cc
  1. Move the now_usec.so to mysql plugin directory
  2. Create the function in mysql:
mysql> create function now_usec returns string soname 'now_usec.so'; 
  1. Test the the function:
mysql> select now_usec();

Temporalize Utility

This version includes a utility to "temporized" a schema, which consists of:

  • Add two columns (tstart, tend) to each table.
  • tend column is appended to all primary keys.

Limitations

  • The current version support MySQL and PostgreSQL.
  • For practicality reasons the level of granularity is the microseconds, ie: for two txns on the same row and withing the same microsec, only the first is kept.
  • Timestamps in MySQL are in a decimal format.
  • A now_usec() UDF needs to be added to MySQL.
  • batch statements are not supported.

Version

Temporal JDBC Proxy 0.1 (Alpha)

Contact

Carlo Curino

License and Restrictions

The Temporal JDBC Proxy is a free software released under the Apache v.2.0 license.

Powered by Google Project Hosting