Can the DataStax Java Driver be safely used in EE containers?

cassandra, datastax-java-driver, jakarta-ee, java

Solution

I do remember that advice. I think that's an old recommendation meant to emphasize that in most of the cases the application should not try to do extra thread management for the container (the key word here is "container"). Also messing up with threads might lead to over utilizing the resources of your server. In the days of single/dual-cores that was quite important.

Anyways, today we have:

- more cores

- more applications that use an asynchronous model

The DataStax driver allows you to configure the max thread pool sizes so you can keep things under your control.

Concluding, I think it should be pretty safe to use the driver. You can tune the thread pool according to your app needs and server(s) resources.

Problem

The documentation of the `com.datastax.driver.core.Session` class states that (...) Each session maintains multiple connections to the cluster nodes (...) However, general advice for EE environments is to leave pooling and thread management to the container. It seems to me that the DataStax driver, which is not primarily targeted at EE environments, violates this rule. This makes me worry whether the driver can be safely used in my EE application.

Original source