Skip to main content
This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.
LinkedIn
Copied!

Integrating Cassandra with your application

Cassandra is an open source, distributed, and high-performance database for storing high volumes of data. In Pega Platform™, you can use this database to stage data for fast decisions or when you want to access data very quickly by using a particular key. Pega Platform includes an internal Cassandra database cluster to which you can connect through the Decision Data Store service. Pega Platform also supports connections to external Cassandra clusters through the Decision Data Store service or through a dedicated Database Table data set. You can use a variety of connection options to create flexible solutions in your business application.

Discover the methods for integrating Cassandra with your application in the following sections:

About Decision Data Store

Pega Platform controls the data model in Cassandra nodes that are configured as part of the Decision Data Store service (both internal and external). When you assign a specific node to be a Decision Data Store node, that node does not contain an underlying data model. The Decision Data Store type data sets define the data model in Pega Platform. When you create a data set, you must specify its type as Decision Data Store and add keys that reflect the data model that you want. When you save the data set, Pega Platform propagates your data model to decision data store nodes.

For more information, see About Data Set rules.

Plan your data model carefully. Add each property that you want to query as a key in the Decision Data Store data set. An excessive number of keys negatively affects the performance of the data set. After saving the data set, you cannot change the keys that you create.

For more information about designing you Decision Data Store data model, see XCAR in Decision Data Store.

Internal Cassandra

When you add a Pega Platform node as a Decision Data Store node to the cluster, a Cassandra instance is automatically deployed on that node as an independent JVM process.

Pega Platform includes Cassandra 3.11.3.

To configure a Decision Data Store node, you define the node type during provisioning.

Internal Cassandra Decision Data Store node
Internal Cassandra decision data store node
Internal Cassandra Decision Data Store node

Cassandra-based decision data store in a Pega Platform node cluster

Each Pega Platform node that is configured as a Decision Data Store node has its own Cassandra database process. All Cassandra database processes in a Pega Platform node communicate with each other to create a distributed database in which decision data is evenly distributed across all Decision Data Store nodes. You can add more Pega Platform nodes to the Decision Data Store service to add more disk space to accommodate decision data, to improve decision data processing, or to secure your data through decentralization.

Decision Data Store node details
Decision Data Store node details
Decision Data Store node details

External Cassandra

You can connect to external Cassandra clusters to store your data. You can configure the Decision Data Store to use external Cassandra clusters and determine the data schema. Alternatively, you can define the database to point to your cluster and access the data with your custom schema through the Database Table data set.

Pega Platform supports connections with external Cassandra in version 2.1 or higher.

To configure an external Cassandra cluster, complete one of the following tasks:

Configuring external Cassandra cluster for use in the Decision Data Store service

Use this method when you want to use a Cassandra cluster with your decision data that is external to Pega Platform. In this case, you control the Cassandra data from your application through Decision data sets.

  1. On the Cassandra cluster, turn on the authentication for each node in the cluster:
    1. In the cassandra.yaml file, configure the authenticator:PasswordAuthenticator parameter.
      By default, the value of this parameter is: authenticator:AllowAllAuthenticator
    2. Restart all Cassandra nodes.
  2. Create a Cassandra user account.
  3. Ensure that the Cassandra user is present on all nodes by setting the replication factor for the system_auth parameter to the number of nodes in the cluster.
  4. On any of the Cassandra nodes, run the nodetool status command and check whether the status of each node is OK.
    The status list should show all the nodes to which you want to connect from your application.

You can now use the Cassandra user credentials to connect to the external Cassandra cluster from Pega Platform.

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

Apply this method to define the database to point to your cluster and access the data with your custom schema. Use the Database Table data set to read and write to Cassandra by defining the data set on a class that is mapped to the Data-Admin-DB-Table Cassandra table. Assign the table to the Data-Admin-DB-Name database that is configured to use Cassandra.

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 Create > SysAdmin > Database.
  2. In 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. In 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 Create > SysAdmin > Class.
  2. In 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. In 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.

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. 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 Create > SysAdmin > Database Table.
  2. In the Create Database Table form, enter a short description and a name for the class.
    The name is case-sensitive.
  3. Click Create and open.
  4. In the Edit Database Table form, in the Database field, select the Cassandra database that you configured in Creating a Cassandra database instance.
  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 Create Data Set form, in the Label field, enter a name for the data set.
  2. In the Type list, select Database table.
  3. In the Context section, select the same application and ruleset for the data set as for the Cassandra database that you configured in Creating a Cassandra database instance.
  4. Click Create and open.
  5. In 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.
  6. Click Save.

You can now access your decision data that you store in an external Cassandra cluster through the Database Table data set.

Cassandra use cases

Designating Cassandra to be the data store for Pega Platform decisioning operations returns the greatest benefit when you use the full potential of the Cassandra database in your solution. Delayed adaptive learning and Visual Business Director demonstrate the Cassandra capabilities for managing large and active data sets in decision management.

Delayed adaptive learning

When customers are presented with offers, they often do not respond to them immediately but take some time to evaluate those offers and respond. In delayed learning, when an offer is made to a customer and there is no immediate response, Cassandra caches the interaction record for a specified maximum period of time. When the customer responds, Pega Platform retrieves the interaction record from the Cassandra cache at high speed, then attaches the response, and sends that record to an adaptive model for analysis.

For more information, see Delayed learning of adaptive models.

Visual Business Director

You can use Visual Business Director (VBD) to view the performance of actual and proposed strategies at a detailed level with a three-dimensional view. On the Visual Business Director tab of the Services landing page, you can define the number of decision data store nodes that are purposed to run business monitoring and reporting. The VBD decision data nodes store customer interaction history in the form of dimensions, properties, and key performance indicators for which your application later queries to visualize decision results.

For more information, see Visual Business Director.

Did you find this content helpful?

Related Content

Have a question? Get answers now.

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

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

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

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us