From the version 5.2 onwards of Open Source BI Helical Insight, we are directly supporting Cockroach DB out of the box. Hence the steps mentioned in this blog are not required. In the below image we have highlighted from where you can find out about the current version of your Helical Insight instance.
Connection string is something like below
Example :
Host: klutzy-insect-7667.8nk.cockroachlabs.cloud Port: 26257 Database Name: defaultdb Datasource Name: Cockroachdb User Name: **Username** Password: **password**
If you are using version older than version 5.2, then only you need to read further this blog in order to make it compatible with CockroachDB.
In this blog we are going to cover how to connect and use Open source BI product Helical Insight with cockroach db.
What is CockroachDB:
CockroachDB is a distributed, open-source relational database system designed to provide high availability, strong consistency, and horizontal scalability.
Features of CockroachDB DB:
- Distributed Architecture: CockroachDB is designed to be a distributed system, allowing it to scale horizontally by adding more nodes to the cluster.
- Consistency and ACID Transactions: CockroachDB adheres to the principles of ACID (Atomicity, Consistency, Isolation, Durability) transactions, ensuring data consistency and reliability.
- >Horizontal Scalability: CockroachDB can scale horizontally by adding more nodes to the cluster. This enables it to handle increased workloads and provides better performance.
- Strong Consistency Guarantees: CockroachDB provides strong consistency guarantees, meaning that all nodes in the cluster have a consistent view of the data at all times.
- Multi-Active Availability: CockroachDB allows for multi-active availability, meaning that multiple nodes can accept both reads and writes simultaneously.
Connect CockroachDB to Helical Insight
As Helical Insight is a Java-based open-source business intelligence framework we need JDBC driver to make a DBconnection.
NOTE: By default, Helical Insight includes a Postgress Driver (which is slightly older versin) but in order to connect to CockroachDB we need Postgress driver of a higher Version i.e. 42.6.0 or higher (postgresql-42.6.0). Hence we need to remove the already present older Postgress driver and put the newer driver.
How To Remove Old Driver:
Go to Helical Insight UI >> Home >> Plugins
Find the Postgress Driver and Delete.
How To Add New Verson:
Download Version 42.6.0 JDBC driver here:
https://jdbc.postgresql.org/download/postgresql-42.6.0.jar
Now in Helical Insight UI go to Data sources
Click On New Add Driver
After clicking on that add driver you can see a new tab there
Click on Upload driver and select the downloaded Postgres JDBC driver
Then do a hard refresh of the datasourcs page, now you can see the Postgres JDBC driver in Data sources
Now click on that Postgress driver
Host: klutzy-insect-7667.8nk.cockroachlabs.cloud Port: 26257 Database Name: defaultdb Datasource Name: Cockroachdb User Name: **Username** Password: **password**
Provide the required details and Test the connection After getting Connection successful, Save the Datasource.
Setting Up Configuration Files in Backend:
Helical Insight requires efwd, XML and JS files to access Metadata and Functions of Cockroachdb
Link: cockroachdb.zip
EFWD FILE:
Path: …hi\hi-repository\System\Admin\DbConfig
Go to this path and add(paste) the downloaded Cockroachdb.efwd file
XML and JS files:
Path: …\hi\hi-repository\System\Admin\SqlFunctions
Go to this path and paste the add(paste) the Cockroachdb.xml and Cockroachdb.js file
Configuring Files:
STEP1: Now we need to map those files with driver class
Path: …\hi\hi-repository\System\Admin\sqlDialects.properties
Open sqlDialects.properties and add below text
#Cockroachdb org.postgresql.Driver=org.hibernate.dialect.PostgreSQLDialect
ex: line no 45,46
add save the file (required administrator access).
STEP2: Now Lets map the driver class with XML function file
Path: …\hi\hirepository\System\Admin\sqlFunctionsXmlMapping.properties
Go to the above path and open sqlFunctionsXmlMapping.properties and add below text
#cockroachdb org.postgresql.Driver=cockroachdb
ex:
add and save the file (required administrator access).
After completing above steps you need to restart the Helical Insight application
WINDOWS: Search ‘Services’ in search bar
Now you can see list of services running find HelicalInsight and right click and restart it will few seconds to restart
In a similar way for restarting Helical Insight service on Linux machine,
For Linux , to check the status of the service, run the following command:
service HelicalInsight status
You can restart the service by running the following set of commands:
service HelicalInsight stop
service HelicalInsight start
After restarting you can use Helical Insight application to connect to Cockroach DB and create reports dashboards also.