Skip to content

Cassandra

The Cassandra plugin adds support for Apache Cassandra. The class CassandraDAO is a DAO implementation and is responsible for connecting to a Cassandra cluster and storing/retrieving objects (items) to/from it. All operations are carried out using the latest Cassandra Java Driver by DataStax, compatible with Cassandra 3.x.

There are several configuration properties for Cassandra (these go in your para-application.conf file):

propertydescription
para.cassandra.hostsComma-separated server hostnames (contact points). Defaults to localhost.
para.cassandra.portThe server port to connect to. Defaults to 9042.
para.cassandra.keyspaceThe keyspace name that Para will use. Default is equal to para.app_name.
para.cassandra.userThe username with access to the database. Defaults to "".
para.cassandra.passwordThe password. Defaults to "".
para.cassandra.replication_factorReplication factor for the keyspace. Defaults to 1.
para.cassandra.ssl_enabledEnables the secure SSL/TLS transport. Defaults to false.

The plugin is on Maven Central. Here’s the Maven snippet to include in your pom.xml:

<dependency>
<groupId>com.erudika</groupId>
<artifactId>para-dao-cassandra</artifactId>
<version>{version}</version>
</dependency>

Alternatively you can download the JAR from the “Releases” tab above put it in a lib folder alongside the server JAR file para-x.y.z.jar. Para will look for plugins inside lib and pick up the Cassandra plugin.

Finally, set the config property:

para-application.conf
para.dao = "CassandraDAO"

This could be a Java system property or part of a para-application.conf file on the classpath. This tells Para to use the Cassandra Data Access Object (DAO) implementation instead of the default.

See Plugins for more information about how you can create your own plugins.