Getting started with the Cassandra database

This page contains information to help you get started with Cassandra in Semarchy xDI.

Connect to your data

Create a metadata object

From the xDI Designer Project Explorer, open or create a project, and create a metadata object inside it.

When creating the metadata object, select Cassandra from the list.

An image of the metadata type selection screen showing that Cassandra is under RDBMS types

The metadata creation wizard offers to create a Cassandra module, or use an existing one.

Reverse-engineer the database

The reverse engineering launches after you create the metadata object. You can also launch it from the top-level metadata Server node by opening its context menu, and selecting Actions > Launch Server Wizard.

Connection

First, fill out the Cassandra connection properties as follows:

Name

A label for the top-level metadata server node.

Module

The name of a Cassandra module to use for the connection.

Nodes

A list of Cassandra nodes to use for this metadata and connection specifically. This table takes IP addresses or hostnames, and ports, per entry.

Datacenter

The name of the datacenter group of nodes, as set in the remote Cassandra configuration.

Username

Username for the connection.

Password

Password for the connection.

An image of the Cassandra wizard

Click Connect to test the connection. If the connection succeeds, continue to the next steps in the wizard. Otherwise, take note of the error, and check your parameters.

The contents of the Datacenter field must match the nodes' configuration.

If it does not match, Designer shows a popup with the error No node was available to execute the query. The error console also shows an error entry with the text You specified <datacenter> as the local DC, but some contact points are from a different DC. The error entry lists the Cassandra nodes you entered, and may show their expected datacenter value.

Schema

Select the Cassandra schema to reverse-engineer, and continue.

Datastores

Select one or more datastores you want to include in the reverse engineering process, and continue.

Nodes

Select which data in your Cassandra datastore you want to define as part of the Designer metadata object.

Click Finish to end the wizard. Save your changes, and your metadata is ready to use.

Notes and tips

Available drivers

By default, the Cassandra component uses a dedicated driver to connect to databases. Previous versions of Semarchy xDI used a general-purpose ODBC driver. The ODBC driver is offered for compatibility purposes, but is now deprecated.

Metadata from previous versions of Semarchy xDI that used the ODBC driver do not switch to the current driver automatically. You should change the driver in the metadata properties:

  1. From the Project Explorer, open the metadata object in its own tab.

  2. Click on the top-level server node to open the properties.

  3. In the Standard tab, find the field labeled Driver.

  4. If the field contains com.semarchy.xdi.jdbc.odbc.JdbcOdbcDriverWrapper, either switch it to the com.semarchy.xdi.jdbc.cassandra.CassandraDriver option, or deactivate the field.

  5. Save your metadata object.

Cassandra metadata properties showing the newer driver
Current Cassandra driver configuration

Sample Project

The Cassandra Component ships sample project(s) that contain various examples and use cases.

You can have a look at these projects to find samples and examples describing how to use it.

Refer to Install Components to learn how to import sample projects.