Informix

New Informix JDBC Driver 4.50.JC1

By Pradeep Natarajan posted Mon May 13, 2019 06:51 PM

  

What's new with the JDBC driver for Informix

Author: Brian Hughes, HCL

The past couple of years have seen vast improvements in quality, performance and modernization for JDBC.  The newest major version of our driver, JDBC 4.50.JC1, is no exception.  It continues the three-pillar trend that started just over two years ago: modernization, performance, and quality.

Modernization

Much has changed since the last major version of Informix and JDBC was launched. For me, the notable change was the industry supporting Java 8 as the minimum requirement for Java libraries.  With this trend, we have followed suit.

Java 8

Informix JDBC driver 4.50.JC1 will require Java 8 or higher to run. This allows us to support higher JDBC specifications as well as leverage the new APIs and improvements in the Java language. You will enjoy better performance and more features as we leverage the newer Java APIs.

JDBC 4.2 Compliance

As late as 2016, the JDBC driver for Informix was stuck on JDBC 3.0 standard, and was over a hundred APIs away from even reaching the 4.0 JDBC specification.  Now I'm proud to say that the new 4.50.JC1 JDBC driver has reached the JDBC 4.2 required feature specifications parity.

JDBC 4.2 specification gives a new SQLType enum which is easier to use than the older Types.java constants class. Tt allows the use of LocalDate, LocalTime, LocalDateTime objects which are faster and sometimes easier to work with than the older Date/Time/Timestamp classes.  Some APIs are not supported by the server itself, so you still might find some pieces unavailable.  We have worked hard to enable as many APIs as possible so you have the flexibility to use as much of the JDBC specification as you need in your applications.

Enhanced BSON Support

JDBC gets a nice bump in its underlying BSON library. Upgrading the BSON library from 2.14 to 3.8 substantially improves the JDBC driver performance and memory usage in dealing with BSON objects. The IfxBSONObject class has been enhanced to take advantage of this upgraded library. Users will have more APIs to more easily access and manipulate BSON objects.  BSON objects are now more often stored and kept in their native byte format rather than fully parsed as Java objects, substantially saving on memory allocations and garbage collection.

 

Performance

A database driver is such a tiny, but important piece of software. It is the bridge between your application and the database, between you and your data. Its performance is critical. No amount of smart application coding can truly make up for the performance of the driver.

JDBC driver performance had taken a back seat for Informix for a long time. However, for the past two years I have been poking and prodding the driver, finding slow code paths, insufficient buffers, and wasted CPU cycles.  And today you can enjoy the rewards of that focused efforts.  JDBC 4.50.JC1 is faster and more performant than the driver has been in the last 6 years.  To show it, we wrote a set of tests to try to capture the relative improvements from the older drivers to the new.  As a caveat, I want to note that these are synthetic tests with a local server and you might not see the same gains in your environment.



(Graph 1: Performance Testing JDBC 4.10.JC4 vs 4.50.JC1
Performance Improvement (higher is better)

Enhanced BSON Support

JDBC gets a nice bump in its underlying BSON library. Upgrading the BSON library from 2.14 to 3.8 substantially improves the JDBC driver performance and memory usage in dealing with BSON objects. The IfxBSONObject class has been enhanced to take advantage of this upgraded library. Users will have more APIs to more easily access and manipulate BSON objects.  BSON objects are now more often stored and kept in their native byte format rather than fully parsed as Java objects, substantially saving on memory allocations and garbage collection.

 

Not only have we worked hard improving the overall performance of the driver, we also bring along a new performance feature which is long overdue:  PreparedStatement caching. You can use PreparedStatement caching to cache a set of PreparedStatement or CallableStatement objects for each connection you have open. This means that your common PreparedStatements can be automatically cached (and along with using a connection pooling system), you can enjoy near instantaneous statement preparation for your SQL statements.

Do note that keeping PreparedStatement objects open costs memory on both the client and the server, but if you have a little memory to spare, this feature can improve your query times.



Quality

Of course, all these improvements are only good if the driver functions reliably.  To help ensure that it does, we have had a parallel campaign to refactor and validate the features of the JDBC driver.  This work started with JDBC 4.10.JC8 and continues today with the latest 4.50.JC1.  The code coverage continues to increase, and complex areas of the code are continuously being refactored. Using metric tracking tools like SonarQube, the JDBC driver project is at the forefront of analyzing quality metrics to improve project stability and quality.

For JDBC, quality is measured in 3 ways.  First, code coverage.  Since introducing code coverage 2 years ago we have improved steadily, from a meager 37% coverage to over 50% coverage today.  Second, we measure the warnings + static code analysis. Here, we have dropped our compiler warnings over the last two years by 87%, with a 19% drop in static analysis warnings. Finally, we look at the defect inflow from customers, and see whether we have introduced bugs in the areas we have cleaned up.  Taken together we hope these three measurements will bring a higher quality driver which is fast, feature rich, and stable for your applications.

Download it now

As with the last few releases of JDBC, you can find the latest version, 4.50.JC1 out on Maven Central! This is in addition to the standard locations you would expect to find the JDBC driver.  Maven makes it simple to integrate the driver into most modern build systems and easy to download, making Maven an ideal choice to stay up to date on the latest release of the Informix JDBC driver.

 



0 comments
17 views

Permalink