Cassandra DB

Discover more about the Cassandra DB component and how to use it on the Digibee Integration Platform.

Cassandra DB performs operations on an Apache Cassandra database connection.

Parameters

Take a look at the configuration parameters of the component. Parameters supported by Double Braces expressions are marked with (DB).

Parameter
Description
Default value
Data type

Account

Account to be used by the component to connect to AWS. It can be type AWSv4, with access key and secret or Basic for access to Cassandra server in a data center, with user and password.

N/A

String

Operation

Operation to be performed (Insert, Update, Select, Delete).

N/A

String

Connection String

Connection string with host, port, and keyspace to use.

cassandra://localhost:9142/keyspace

String

Query (DB)

CQL specification, depending on the selected operation. This parameter accepts Double Braces.

SELECT * FROM EXAMPLE

String

Max Wait For Operation (in ms)

Time (in ms) the application must wait until the query is finished.

60000

Integer

Heartbeat Connection Timeout (in ms)

Dummy request to keep connections alive in the pool.

60000

Integer

Fail On Error

If the option is enabled, the execution of the pipeline with error will be stopped; otherwise, the pipeline execution continues, and the result will show the value false for the "success" property.

False

Boolean

Advanced

Opens further configuration options.

False

Boolean

Pool Size By Actual Consumers

If "true", the number of pooled connections will be equivalent to the number of consumers configured during pipeline deployment; if "false", then the pool size is given by the pipeline deployment size, irrespective of the number of consumers.

False

Boolean

Cassandra DB in Action

CQL (Cassandra Query Language), as the name implies, is the query language for Cassandra. It uses variables in its queries by wrapping them in Double Braces, like {{id}}. Read more in our article about Double Braces Functions.

Operation Insert

Input

  • Account: cassandra-acc

  • Operation: Insert

  • Connection String: {{global.cassandra-url}}

  • Query: INSERT INTO CUSTOMER (id, first_name) VALUES ({{ message.id }}, {{ message.name }});

  • Fail On Error: false

Output

{
	"data": {},
	"insertCount": 1
}

Operation Update

Input

  • Account: cassandra-acc

  • Operation: Update

  • Connection String: {{global.cassandra-url}}

  • Query: UPDATE CUSTOMER SET first_name = {{ message.newName }} WHERE id = {{ message.id }};

  • Fail On Error: false

Output

{
	"data": {},
	"updateCount": 1
}

Operation Select

Note: Databases such as Cassandra or AWS Keyspaces may automatically return paginated results if they have a significant number of registers. The Digibee Integration Platform handles this pagination automatically to consolidate the result at the output of the component as an atomic query. This means that no configuration or additional actions are required by the user to obtain these results.

Input

  • Account: cassandra-acc

  • Operation: Select

  • Connection String: {{global.cassandra-url}}

  • Query: SELECT * FROM CUSTOMER WHERE id = {{ message.if }};

  • Fail On Error: false

Output

{
	"data": [{
		"id": "5095e726-d790-4f93-9a71-10ecf2cdd72f",
		" firstName": "Rafael",
		" lastName": "Garbin"
	}],
	"rowCount": 1
}

Operation Delete

Input

  • Account: cassandra-acc

  • Operation: Delete

  • Connection String: {{global.cassandra-url}}

  • Query: DELETE FROM CUSTOMER WHERE id = {{ message.if }};

  • Fail On Error: false

Output

{
	"data": {},
	"deleteCount": 1
}

Last updated