Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Connecting to an external Cassandra database through a Database Table data set

Updated on March 28, 2022

Connect Pega Platform to an external Cassandra cluster through a dedicated Database Table data set so that you can use custom tables that you store in Cassandra in data flows to read and write data. You can access your custom data model by mapping the model to a Pega Platform class.

To set up the connection, define a database instance that points to your Cassandra cluster and create a class mapped to the Cassandra cluster. Define a table in the Cassandra class and map it to the Cassandra database instance. Finally, define a Database Table data set in the Cassandra class.

Creating a Cassandra database instance

Start the configuration of the connection to an external Cassandra by creating a Cassandra database instance.

  1. In the header of Dev Studio, click CreateSysAdminDatabase.
  2. On the Create Database form, enter a short description and a name for the database.
    The database name is case-sensitive.
  3. Click Create and open.
  4. On the Edit Database form, in the Integration system field, enter: Pega
    This parameter indicates the integration system that is associated with this database. The value that you enter is for informational purposes only, and does not affect the behavior of the database instance. You can use this value to organize rules for integration connectors, data types, and sources for data pages.
  5. In the How to connect list, select Use Cassandra cluster configuration listed below.
  6. In the Cassandra Hostnames and Ports section, click Add Host, and then enter a hostname or IP address and port for a node in the Cassandra cluster.
    You can specify multiple hosts.
  7. In the Cassandra Cluster section, enter the keyspace, username, and password that you use to connect to the database.
  8. Test the database connection by clicking Test connection.
  9. Click Save.

Creating a class to map to Cassandra

After configuring a Cassandra database instance, define a class that is mapped to the Data-Admin-DB-Table Cassandra table.

  1. In the header of Dev Studio, click CreateSysAdminClass.
  2. On the Create Class form, in the Label field, enter a description of the class.
  3. In the Class Name field, enter the name of the class.
  4. In the Context section, select the application and ruleset for the class.
  5. Click Create and open.
  6. On the Edit Class form, in the Select class type list, select Concrete.
  7. In the Settings section, in the Created in version field, enter the version of the ruleset that you want to use for the class.
  8. In the Keys section, provide the Cassandra table partition keys.
    The keys may be compounds with many values.
  9. In the Class inheritance section, in the Parent class (Directed) field, enter the name of the directed inheritance parent class.
  10. On the External mapping tab, define all columns that you want to read or save to Cassandra, and then map them to existing properties.
  11. Click Save.
What to do next: After changing class external mappings, save all existing data sets to populate the new mappings definition.

Defining the Cassandra table

Create a Data-Admin-DB-Table instance to configure a Cassandra table and map the table to the class that you configured earlier. You can either search for an existing table by the class name or create a new table.

  1. In the header of Dev Studio, click CreateSysAdminDatabase Table.
  2. On the Create Database Table form, enter a short description and the name of the Cassandra class that you configured earlier.
    The name is case-sensitive.
  3. Click Create and open.
  4. On the Edit Database Table form, in the Database field, select the Cassandra database that you configured earlier.
  5. In the Table name field, enter the name of an existing table.
  6. Test the database connection by clicking Test connectivity.
  7. Click Save.

Creating a Cassandra Database Table data set

Complete the external Cassandra connection configuration by creating a dedicated Cassandra data set that you can later use to access your external data in Pega Platform.

  1. In the header of Dev Studio, click CreateData ModelData Set.
  2. On the Create Data Set form, in the Label field, enter a name for the data set.
  3. In the Type list, select Database table.
  4. In the Context section, configure the context settings for the data set:
    1. In the list of applications and in the Add to ruleset field, select the same application and ruleset as for the Cassandra database that you configured earlier.
    2. In the Apply to field, select the Cassandra class that you configured earlier.
  5. Click Create and open.
  6. On the Edit Data set form, in the Selectable keys section, click Add key, and then define the Cassandra table cluster keys.
    The form displays the database table details, such as the table name, the database type, and the partitioning keys. The details are retrieved automatically from the class definition.
  7. Click Save.
Result: You can now access your decision data that you store in an external Cassandra cluster through the Database Table data set.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us