GCP Cloud Spanner Connector for Camunda 8

Integrating Camunda with Google Cloud Spanner offers a powerful combination of workflow automation and a globally distributed, horizontally scalable database. Google Cloud Spanner provides strong consistency and high availability, making it suitable for storing critical process data. The integration involves storing and retrieving both business and process data in Cloud Spanner. This ensures efficient process execution and data management within a scalable and reliable infrastructure.

The GCP Cloud Spanner Connector provides features to integrate Camunda Workflows with GCP Cloud Spanner.

  • Written by

  • Akash Ram P
    Camunda Expert at Acheron
  • August 29, 2023
  • 9 mins read

Google Cloud Spanner

Cloud Spanner is a globally distributed, horizontally scalable, and strongly consistent relational database service provided by Google Cloud Platform. It's designed to seamlessly combine the benefits of traditional relational databases with the advantages of a globally distributed architecture. Cloud Spanner enables organizations to build and deploy applications that require high availability, global replication, and strong transactional consistency without sacrificing performance.

For more information refer this link for Spanner Documentation.

What is Camunda 8

Camunda Platform 8 is a powerful tool that helps manage complex business processes involving people, systems, and devices. It allows business users to work together with developers to design and automate entire processes using flowcharts powered by BPMN (Business Process Model and Notation).

It also includes DMN (Decision Model and Notation) decision tables that help make decisions quickly, efficiently, and based on logical rules. This combination of features supports efficient workflows and decision-making at scale.

For more Info visit :

Prerequisites

  • Create Service Account access credentials for your project in Google Cloud Storage
  • You can refer to the guide available on GitHub.

Cloud Spanner Connector with Camunda 8 self-managed

  • Download and Save the element template of spanner connector from GitHub to Desktop Modeler resources. Eg: C:/Apps/camunda-modeler-5.13.0-win-x64/resources/element-templates/spanner-connector.json.
  • Restart the Desktop modeler for getting the template.

Using Spanner Connector in Desktop modeler

  • Create a new BPMN diagram for Camunda 8
  • Create a task and click the wrench icon on right side
  • Search and select Google Cloud Spanner Connector element template
  • In the connector template choose the operation type you want to perform

Spanner Connection

  • Spanner Connection details must be filled for all the operations
  • This is to establish a connection between the connector and the spanner database of the user.

Functionalities of the connector

Create a table

  • This operation will allow you to create a table in your cloud spanner database.
  • Provide the following details

Table Name

Name of the table to be created in the Spanner database

Columns List

Enter the column name and its data type to be in the table in a json format

Primary Key

Enter the name of the column which has to be the primary key

Here is a sample how the fields should be filled to create a table in cloud spanner database.

Json Format:

  • colName: Here you need to enter the Column name
  • dataType: Here you need to enter the Data type of the column

Insert data to table

  • This operation will allow you to insert a data to a table in the spanner database
  • Provide the following details

Table Name

Name of the table where data to be inserted in the Spanner database

Data to be inserted

Enter the values with column names in a json format to be inserted

Here is a sample how the fields should be filled to insert a data to a table in cloud spanner database.

*Note: You can insert up to two data in a single instance, here is a sample how to enter two data in json format

[ { "bookId": 1, "bookName": "\"Two States\"", "author": "\"Chetan Bhagat\"" }, { "bookId": 2, "bookName": "\"Harry Potter\"", "author": "\"J K Rowling\"" } ]

Json Format:

[ { "columnName1": columnValue1, "columnName2": "\"columnValue2\"", } ]

Update data in table

  • This operation will allow you to update a data in the table
  • Provide the following details

Table Name

Name of the table where data to be updated in the Spanner database

Set: Column Name

Enter the name of the column name to be the column for set condition

Set: Value

Enter the value for ‘set’ condition

Where: Column Name

Enter the name of the column name to be the column for where condition

Where: Value

Enter the value for ‘where’ condition

Here is a sample how the fields should be filled to update a data to a table in cloud spanner database.

Delete a data in table

  • This operation will allow you to delete a data in table
  • Provide the following details

Table Name

Name of the table where data to be deleted in the Spanner database

Where: Column Name

Enter the name of the column name to be the column for where condition

Where: Value

Enter the value for ‘where’ condition

Here is a sample how the fields should be filled to delete a data from a table in cloud spanner database.

Retrieve data from table

  • This operation will allow you to retrieve data from a table in the spanner database
  • Provide the following

Table Name

Name of the table from where data to be retrieved in the Spanner database

Columns to display

Choose “All” to retrieve all the columns from the table

Choose “Selected columns” to retrieve only the selected columns from the table

Where: Column Name

Enter the name of the column name to be the column for where condition

Where: Value

Enter the value for ‘where’ condition

Limit

Enter the number of data to be retrieved from the table.

Order By: Column Name

Enter the name of the column name to be the column for order condition

Order By

Choose the order to be “Ascending“ or “Descending“

Here is a sample how the fields should be filled to retrieve data from a table in cloud spanner database.

*Note: You can enter “null“ for the fields: “Where: Column Name“, “Where: Value“, ”Limit” and “Order By: Column Name“

Conclusion

In conclusion, Google Cloud Spanner Connector is a powerful relational database service that offers various operations to perform in the cloud spanner database. This tool simplifies how Camunda workflows interact with Google Cloud Spanner database. By following the outlined steps, users can effectively leverage the Cloud Spanner Connector within Camunda's Desktop Modeler. It's like having a reliable assistant for your data tasks, making things easier and more accessible.

Contact :

More to explore