DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

kumar.bharathb023_111999 avatar image
kumar.bharathb023_111999 asked ·

How do we upgrade from native protocol version v2 to v3?

Hi All,

How to update Native Protocol version from V2 to v3 ? (Reason: Better Pooling options)

We are using: DSE 6.0 and Cassandra 4.0 .

Thanks,

Bharath Kumar B

driver
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

The fact that your app is still using native protocol v2 indicates that you are using a very old driver version. Let me explain.

Protocol versions

Native protocol v3 was added in Cassandra 2.1 by CASSANDRA-6855 in 2014.

Native protocol v4 itself is quite old too having been added in C* 2.2 by CASSANDRA-8043 in 2015.

At the time of writing, there is a new native protocol proposed for C* 4.0 (unreleased and still in beta). Native protocol v5 is currently in beta and the implementation is still incomplete (CASSANDRA-9362).

DSE protocols

For some background info, the drivers were previously "split" such that there were 2 forks. In the case of the Java driver:

  • dse-java-driver - a Java client for DataStax Enterprise designed to only work with DSE and had access to DSE-only features such as DSE Graph.
  • java-driver - a Java client for open-source Apache Cassandra.

In addition to the native protocols above, there are special protocols that the DataStax drivers use when connecting to DataStax Enterprise (DSE) clusters.

DSE protocol DSE_V1 is used for connecting to DSE 5.1 (and newer) clusters to access DSE-only features. DSE_V2 version was added to support new features in DSE 6.0 (and newer) clusters. See DseProtocolVersion.java for details.

In January 2020, we announced that we have unified the drivers into one to make it simple for users. From Java driver 4.4.0, there is just one version to use to connect to any cluster -- DSE, open-source Apache Cassandra, DataStax Astra.

Usage

In the driver, you would typically specify an older protocol version if you are connecting to a cluster with an older Cassandra version. Here's an example of how you would do it in an older Java driver:

Cluster cluster = Cluster.builder()
    .addContactPoint(...)
    .withProtocolVersion(ProtocolVersion.V2)
    .build();

But you wouldn't "upgrade" to a newer protocol version.

The driver itself negotiates the native protocol version when it connects to a node in the cluster. It will try to negotiate with the default version is supports. In the case of Java driver 4.x, it defaults to v4 and supports native protocol v3 to v5*.

* v5 needs to be enabled explicitly for those users who are testing the beta release.

Recommendation

You should upgrade to a newer version the Cassandra driver you're using. We recommend you use one of the unified drivers. For details, see Chris Splinter's blog post on Better Drivers for Cassandra.

For reference, the compatibility matrix of supported protocols for older versions of the Java driver is available here. See the Native Protocol page for Java driver for more information. Cheers!

3 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hi Erick,

Thanks for your response.

If I am understanding it correctly, V4 or V3 completely depends on Java Driver we are using to make connections to Cassandra.


Incase of DSE 6.0 +, Can I correlate DSE_V2 to Native protocol (v4/v5) ?? Or Are those completely different?

Thanks,

Bharath Kumar B



0 Likes 0 · ·

Hi Erick,

Thanks for your response.

If I am understanding it correctly, V4 or V3 completely depends on Java Driver we are using to make connections to Cassandra.


Incase of DSE 6.0 +, Can I correlate DSE_V2 to Native protocol (v4/v5) ?? Or Are those completely different?

Thanks,

Bharath Kumar B

0 Likes 0 · ·
Erick Ramirez avatar image Erick Ramirez ♦♦ kumar.bharathb023_111999 ·

They're unrelated. I'll update my answer with the details. Cheers!

0 Likes 0 · ·