Databases

InfluxDB

Characteristics - InfluxDB

In case of a time series data use case where you need to ingest data in a fast and efficient way you can use InfluxDB.

Information Model Requirements

Inserts

  • The node after the root model node must be of type Event eventNode which represent a database table.

  • Columns of databases are represented by Variables variableNode.

ExampleInsertModel

How to configure InfluxDB

  1. Select the root model node in the tree on the left.

  2. Configure the InfluxDB

    • Enter the URL to the database

    • Enter the database name

    • Enter the database username and the password

  3. Click the Apply button and save the Channel by clicking the Save button on the upper right corner.

InfluxDBConfiguration
  1. Select the event node in the tree on the left.

  2. Configure Measurements (Tables within InfluxDB)

    • Enter a measurement

    • Enter tag names.

  3. Click the Apply button and save the Channel by clicking the Save button on the upper right corner.

InfluxDBConfigurationEvent

SQL Database

Characteristics - SQL Database

  • The SQL Channel can be configured for the following two scenarios:

    • Inserting data

    • Updating data

    • Retrieving data

  • When inserting values into the database please note that “infinity” values are converted automatically into “null” values.

Information Model Requirements

Insert/Update

  • The node after the root model node must be of type Event eventNode which represent a database table.

  • In case of relational databases: Tables which are dependent on each other require a List listNode.

  • Columns of databases are represented by Variables variableNode.

Example insert model

Select

  • The Command commandNode defines that after a request is made, a reply with a result is expected.

  • Parameters commandParameterNode within a Command represent a collection of query parameter - query parameters are defined as Variables variableNode.

  • Reply commandReplyNode within a Command represents the result of the Command - results are defined as Variables variableNode.

Example Select Model

How to configure the SQL-Database

  1. Select the root model node in the tree on the left.

  2. Configure the database connection

    • Select the database type.

    • Specify a reconnection interval.

    • Enter the database connection url for the specific database type.

      • DB2: jdbc:db2:server:port/database

      • HSQLDB: jdbc:hsqldb:file:databaseFileName;properties

      • ORACLE: jdbc:oracle:thin:prodHost:port:sid

      • PostgreSQL: jdbc:postgresql://host:port/database

      • SQLServer: jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]

      • MariaDB: jdbc:(mysql|mariadb):[replication:|loadbalance:|sequential:|aurora:]//<host>[:<portnumber>]/[database][?<key1>=<value1>[&<key2>=<value2>]]

    • Enter the database username and password.

SQL Database Configuration
Description of database configuration properties

Property

Description

Mandatory

Example

Type

Type of the database

Yes

MariaDB, SQLServer, ORACLE, HSQLDB, DB2, PostgreSQL

ReconnectInterval

Time to reconnect if connection fails

Yes

10 (in milliseconds)

JdbcUrl

Url to connect to database

Yes

SQLServer: jdbc:sqlserver://<serverName:1433;databaseName=unifier MariaDB: jdbc:mariadb://localhost:3306/unifier?connectTimeout=5000 DB2: jdbc:db2://127.0.0.1:50000/TESTDB HSQLDB: jdbc:hsqldb:file:$dbFileName;shutdown=true ORACLE: jdbc:oracle:thin:@localhost:1521/MYCDB PostgreSQL: jdbc:postgresql://127.0.0.1:5432/postgres

Username and password

Credentials of the database

Yes

Note

The configuration of specific information model nodes differs whether you want to perform an insert or an select statement on the database. Inserting data into the database requires an event node whereas selecting data requires a command node in the Information Model.

Select Statement

  1. Select the command node in the tree on the left.

  2. Check the custom query checkbox and enter the sql query.

SQL Database Configuration
  1. Each variable under Parameters and Reply needs to be assigned to a database column. Select the variable node under Parameters and in the tree select what needs to be configured.

  2. Check the assign database column checkbox and enter the column name as it is defined in the used database.

SQL Database Configuration Assign Database Column

Insert Statement

  1. Select the event node in the tree on the left.

  2. Check the insert checkbox and enter the table name. If required enter a schema name.

SQL Database Configuration Insert