Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is JTDS faster than Microsoft JDBC driver?

we're comparing JTDS and Microsoft SQL Server for a Java EE application running on JBoss and we're finding that JTDS is from 30% to 50% faster, benchmarking the application in a high concurrence scenario and keeping exactly the same HW/SW but changing only the driver in the datasource configuration.

While we've seen a lot of favorable options towards JTDS and so we're thinking to go for it I'm still curious:

  • Why is the JTDS driver so much faster?
  • Why Microsoft never updated its driver to be fast as JTDS?

Comparison was made using the latest JDBC 3.0 version and the latest JTDS version and using a SQL Server 2008 running on a 16 core installation with dedicated SAN.

like image 960
massimogentilini Avatar asked Oct 21 '11 10:10

massimogentilini


People also ask

What is the difference between jTDS and JDBC?

One relevant difference is, that the JDBC 4.0 Implementation of the JTDS-Driver (v1. 3.1) requires at least Java 7, whereas the JDBC 4.0 Implementation of the Microsoft driver is available in Java 6. This is important if you want to use Hibernate 4.3 (relying on JDBC 4.0 API) and support Java 6.

What is jTDS driver?

jTDS is an open source 100% pure Java (type 4) JDBC 3.0 driver for Microsoft SQL Server (6.5, 7, 2000, 2005, 2008 and 2012) and Sybase Adaptive Server Enterprise (10, 11, 12 and 15). jTDS is based on FreeTDS and is currently the fastest production-ready JDBC driver for SQL Server and Sybase ASE.

What is jTDS connection?

JDBC (Java Database Connectivity) is a programming interface that lets Java applications access a relational database. SuperCHANNEL needs a JDBC driver so that it can access the relational database system (e.g. SQL Server, Oracle, etc) where your source data is stored.


1 Answers

I've done similar performance comparisons, with similar results.

There are many potential reasons for performance differences. Some of them are visible in the T-SQL generated by the driver, which you can see with SQL Profiler. Other aspects are more subtle, such as connection management and how the underlying protocol (TDS) is implemented.

I can't say for sure why MS has never updated their driver, but I suspect that part of it is because Java is considered to be a competitive product/platform.

like image 159
RickNZ Avatar answered Nov 16 '22 01:11

RickNZ