Connecting to an Apache Cassandra database
You can connect to an Apache Cassandra database to perform save and select operations on Pega® Diagnostic Cloud alert instances without having to use custom SQL or custom Java. This ability improves horizontal scaling and is useful when you want to use a third-party data and reporting tool to access the data in your database.
Use the following high-level steps to configure your Apache Cassandra database and test your connection to it:
- Create a database instance
- Connect to the database
- Optional: Use a data type to add records to Apache Cassandra to ensure that you can read and write to the database
Before connecting to the database, create a database instance (Data-Admin-DB-Name).
- Click +Create > SysAdmin > Database.
- Enter a short description.
- In the Database field, enter the database name.
- Click Create and open.
Connect to Apache Cassandra.
- On the Database tab, in the How to connect field, click use Cassandra cluster configuration listed below.
- In the Cassandra Hostnames and Ports section, click Add Host.
- In the Hostname field, enter the host name or IP address of a node in the Cassandra cluster.
- In the Port field, enter the port to use to connect to this host.
- Repeat steps 2 through 4 to add more nodes.
- In the Cassandra Cluster section, in the Keyspace field, enter the name of the keyspace in which to store data.
- Optional: In the Username field, enter the user name for accessing Apache Cassandra.
- Optional: In the Password field, enter the password for accessing the Apache Cassandra.
- Click Save.
- Click Test connection.
You can use a data type to add records and create a table in Apache Cassandra to test that you can read and write to the database. This table contains columns for any properties that you define when you create the data type, as well as the properties that are in the parent table.
Set up the data type by completing the following high-level steps:
- From the Data Explorer, click Add data type from the menu at the top right of the explorer.
- Enter a label.
- Enter a description.
- Click Submit. Do not close the data type.
- To identify class keys and create the initial data pages and table, return to the data type that you just created.
- Optional: In the Fields section, click Add field to add fields to your data type. For details about adding fields, see Adding fields to your data model. (link to help)
- Optional: Repeat step 2 to add additional fields.
- Click Save.
- On the Sources tab, click Create a local source.
- Click Use as Key in the rows of the fields that are keys.
- In the Database field, enter the name of the database rule that you previously created in Creating a database instance.
- Click Submit.
- Optional: Click the Records tab and add records to the Apache Cassandra database table.
- Click Save.