Introducing Java driver 4
date: August 1, 2017
Today we are releasing Java driver 4.0.0-alpha1, the first preview of our next major version.
Those of you familiar with semantic versioning will notice that this version number indicates breaking API changes; we felt that this was needed to address a number of longstanding issues:
- Java 8 support: we dropped support for JDK 6 and 7. This allows us to use Java 8 futures in the API, and take advantage of the latest language features like try-with-resources blocks and lambda expressions.
- No more dependency to Guava: this has been a recurring pain point with earlier versions. We're happy to announce that the driver does not depend on Guava anymore (it's still used internally, but shaded).
- Separation of packages into API / internal categories; this allows us to expose more hooks for advanced customization. For example, one thing you can do is override the driver's node discovery mechanism.
- New configuration API with a default implementation based on Typesafe Config.
- Immutable statement types to eliminate thread safety issues.
- Pluggable request execution logic. We plan to use that to provide a reactive extension in the near future.
For full details, please refer to the upgrade guide.
Despite all those changes, the main API should still look familiar to 3.x users. For example, here is the canonical connection example:
The driver is available from Maven central (note that the coordinates have changed):
The sources are on the 4.x branch on GitHub.
This alpha release is an early preview for evaluation by bleeding edge adopters. It has not been fully tested and is not production-ready. The basic request execution logic is functional, but many features are still missing, notably: schema and token metadata, metrics, the query builder, non-default policy implementations, compression.
We'll keep working towards a feature-complete beta in the upcoming months. Look for JIRA tickets with 4.* fix versions for an overview of upcoming tasks (here's a filter for 4.0.0-alpha2 and GA).
In the meantime, you can try the new API and provide feedback on the mailing list, or even pick a ticket and create a pull request (please discuss it with us beforehand, as some tickets may require additional information).