Connectors → MariaDB

About MariaDB

MariaDB is one of the popular open-source relational databases. It is also the default database in most Linux distributions. A relational database organizes data into tables. These tables contain data types that can have relations. These relationships help structure the data. Programmers use SQL to create, extract, modify, and control access to data in a relational database.

MariaDB Connector Updates

This section is to explore the updates in the newer versions of the MariaDB connector available on the Incorta connectors marketplace.

In order to get the newer version of the connector, please update the connector using the marketplace.

VersionUpdates
2.2.0.2A new extra option, sql.chunks.limit, is now available to specify the maximum number of chunks that can be created by a data set when chunking is enabled. The default is 100, and the maximum is 300. If you specify a limit that exceeds 300, the connector resets it to 300.
Recommendation

Keep your connector up-to-date with the latest connector version released to get all introduced fixes and enhancements.

MariaDB Connector

Incorta loads data from a MariaDB database using the MariaDB connector.

Note

The MariaDB connector is a preview connector.

The MariaDB connector supports the following Incorta-specific functionality:

FeatureSupported
Chunking
Data Agent
Encryption at Ingest
Incremental Load
Multi-Source
OAuth
Performance Optimized
Remote
Single-Source
Spark Extraction
Webhook Callbacks
Pre-SQL support
Note

The MariaDB Connector supports two types of incremental load, including support for using a numeric column. To learn more see Types of Incremental Load.

Steps to connect MariaDB and Incorta

To connect MariaDB and Incorta, here are the high-level steps, tools, and procedures:

Create an external data source

Here are the steps to create an external data source with the MariaDB connector:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Data.
  • In the Action bar, select + NewAdd Data Source.
  • In the Choose a Data Source dialog, in Database, select MariaDB.
  • In the New Data Source dialog, specify the applicable connector properties.
  • To test, select Test Connection.
  • Select OK to save your changes.

MariaDB connector properties

Here are the properties for the MariaDB connector:

PropertyControlDescription
Data Source Nametext boxEnter the name of the data source
Usernametext boxEnter the database username
Passwordtext boxEnter the database password
Connection Pooltext boxEnter the connection pool. The default is 30.
Connection Stringtext boxEnter the connection string for the MariaDB JDBC driver. The format is: jdbc:mariadb://<HOST>:<PORT>
The default JDBC port for a MariaDB Database is: 3306. Verify port numbers with your data source configurations.
Connection Propertiestext boxCustomized string input of key/value pair properties. See below for details on connection properties.
Extra Optionstext boxEnter supported extra options in the form of key=value.
Use Data AgenttoggleEnable using a data agent to securely ingest data from an external data source that is behind a firewall.
For more information, please review Tools → Data Agent and Tools → Data Manager.
Data Agentdrop-down listEnable Use Data Agent to configure this property. Select from the data agents created in the tenant, if any.
Important: Data Agent

A data agent is a service that runs on a remote host. It is also a data agent object in the Data Manager for a given tenant. An authentication file shared between the data agent object and the data agent service enables an authorized connection without using a VPN or SSH tunnel. With a data agent, you can securely extract data from one or more databases behind a firewall to an Incorta cluster. Your Incorta cluster can reside on-premises or in the cloud.

You must have the Incorta cluster enabled and configured to support the use of Data Agents. To learn more, see Concepts → Data Agent and Tools → Data Agent.

Connection Properties

The connection properties allow for customized connection to your MariaDB database. The properties are accepted in a key=value format. The type of connector properties can range from username and password to SSL settings.

Create a schema with the Schema Wizard

Here are the steps to create an MariaDB schema with the Schema Wizard:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the Action bar, select + NewSchema Wizard.
  • In (1) Choose a Source, specify the following:
    • For Enter a name, enter the schema name.
    • For Select a Datasource, select the MariaDB external data source.
    • Optionally create a description.
  • In the Schema Wizard footer, select Next.
  • In (2) Manage Tables, in the Data Panel, first select the name of the Data Source, and then check the Select All checkbox.
  • In the Schema Wizard footer, select Next.
  • In (3) Finalize, in the Schema Wizard footer, select Create Schema.

Create a schema with the Schema Designer

Here are the steps to create an MariaDB schema using the Schema Designer:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the Action bar, select + NewCreate Schema.
  • In Name, specify the schema name, and select Save.
  • In Start adding tables to your schema, select SQL Database, and then select the MariaDB external data source.
  • In the Data Source dialog, specify the MariaDB table data source properties.
  • Select Add.
  • In the Table Editor, in the Table Summary section, enter the table name.
  • To save your changes, select Done in the Action bar.

MariaDB table data source properties

For a schema table in Incorta, you can define the following MariaDB-specific data source properties as follows:

|

PropertyControlDescription
Typedrop-down listDefault is SQL Database
Data Sourcedrop-down listSelect the MariaDB external data source
IncrementaltoggleEnable the incremental load configuration for the schema table. See Types of Incremental Load.
Incremental Extract Usingdrop-down listEnable Incremental to configure this property. Select between the Last Successful Extract Time and the Maximum Value of a Column.
See Types of Incremental Load.
Incremental Columndrop-down listEnable Incremental and select Maximum Value of a Column to configure this property. Select the column to be used for the Maximum Value of a Column. The Loader will track and use the greatest value or most recent timestamp for each load operation.
Querytext boxEnter the SQL query to retrieve data from the MariaDB database
Update Querytext boxEnable Incremental to configure this property. Define the SQL update query to use during an incremental load.
Incremental Field Typedrop-down listEnable Incremental to configure this property. Select the format of the incremental field:
  ●   Timestamp
  ●   Unix Epoch (seconds)
  ●   Unix Epoch (milliseconds)
Pre-SQLtoggleEnable running SQL statements or calling stored procedures before executing the original extraction query or incremental query during a load job
Pre-SQL statementtext boxEnter the SQL statements or call the stored procedures that you want to execute before the query or incremental query during a load job
Fetch Sizetext boxUsed for performance improvement, fetch size defines the number of records that will be retrieved from the database in each batch until all records are retrieved. The default is 5000.
Chunking Methoddrop-down listChunking methods allow for parallel extraction of large tables. The default is No Chunking. There are two chunking methods:
  ●   By Size of Chunking (Single Table)
  ●   By Date/Timestamp
Chunk Sizetext boxSelect By Size of Chunking for the Chunking Method to set this property. Enter the number of records to extract in each chunk about the Fetch Size. The default is 3 times the Fetch Size.
Order Columndrop-down listSelect By Size of Chunking for the Chunking Method to set this property.
Select a column in the source table you want to order by before chunking. It's typically an ID column and it must be numeric.
Upper Bound for Order Columntext boxOptional. Enter the maximum value for the order column.
Lower Bound for Order Columntext boxOptional. Enter the minimum value for the order column.
Order Column [Date/Timestamp]drop-down listSelect By Date/Timestamp for the Chunking Method to set this property. Select a column in the source table you want to order by before chunking. It should be a Date/Timestamp column.
Chunk Perioddrop-down listSelect the chunk period that will be used in dividing chunks:
  ●   Daily
  ●   Weekly (default)
  ●   Monthly
  ●   Yearly
  ●   Custom
Number of daystext boxSelect Custom for the Chunk Period to set this property. Enter the chunking period in days
Set Extraction TimeouttoggleEnable the termination of extraction (loading) jobs for the SQL query for this table if the extraction time exceeds the configured time
Stop after (Minutes)text boxEnable Set Extraction Timeout to configure this property. Enter the maximum number of minutes allowed for the loading job to complete before terminating it.
Enable Spark Based Extraction (Deprecated)toggleEnable a Spark job to parallelize the data ingest.
This feature is no longer supported with plans to remove it in future connector versions.
Max Number of Parallel Queriestext boxEnable Spark based extraction to configure this property. In a Spark job, specify the maximum number of parallel queries.
Column to Parallelize Queries ondrop-down listEnable Spark based extraction to configure this property. Select the numerical column in the source table that Spark will parallelize the extraction queries from.
Memory Per Extractortext boxEnable Spark based extraction to configure this property. In a Spark job, allocate the amount of memory per extractor. Units are in gigabytes.
CallbacktoggleEnable post extraction callback, that is, enable callback on the data source data set(s) by invoking a certain callback URL with parameters containing details about the load job.
Callback URLtext boxEnable Callback to configure this property. Specify the callback URL.

View the schema diagram with the Schema Diagram Viewer

Here are the steps to view the schema diagram using the Schema Diagram Viewer:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the list of schemas, select the MariaDB schema.
  • In the Schema Designer, in the Action bar, select Diagram.

Load the schema

Here are the steps to perform a Full Load of the MariaDB schema using the Schema Designer:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the list of schemas, select the MariaDB schema.
  • In the Schema Designer, in the Action bar, select LoadFull Load.
  • To review the load status, in Last Load Status, select the date.

Explore the schema

With the full load of the MariaDB schema complete, you can use the Analyzer to explore the schema, create your first insight, and save the insight to a new dashboard.

To open the Analyzer from the schema, follow these steps:

  • In the Navigation bar, select Schema.
  • In the Schema Manager, in the List view, select the MariaDB schema.
  • In the Schema Designer, in the Action bar, select Explore Data.

Additional Considerations

Types of Incremental Load

You can enable Incremental Load for a MariaDB table data source. There are two types of incremental extracts:

Last Successful Extract Time

Fetch updates since the last time the tables were loaded. Determined by the difference between the current time and the database timestamp.

Maximum Value of a Column

The column-based strategy depends on an extra column called "Incremental Column" in each table. The MariaDB connector supports both timestamp and numeric columns. A timestamp column is of the type date or timestamp. A numeric column is of the type int or long.

Note

Changing the incremental load strategy requires a full load to ensure data integrity.

Incremental Load Example

In this example, the invoices table must contain a column of the type Date or Timestamp to load the table incrementally with a last successful extract time strategy. In this case, the name of the date column is ModifiedDate and the format of the column is Timestamp.

Here are the data source property values for this example:

  • Incremental is enabled
  • Query contains SELECT * FROM 'invoices'
  • Update Query contains SELECT * FROM 'invoices' WHERE 'ModifiedDate' > ?
Note

? is a variable in the update query that contains the last schema refresh date.

  • Incremental Field Type = Timestamp
Note

Incorta replaces the ? reference character with a value.

Valid Query Types

When creating a query for your MariaDB Connector, please note that only SELECT statements are valid.

Pre-SQL support

This feature allows executing SQL statements before executing the original extraction query or incremental query during a load job. This helps in different scenarios, for example, when you need to do one of the following:

  • Run stored procedures
  • Update the data source before extraction
  • Create a temporary table before executing the extraction query
  • Delete old records in the source so that the source includes only the latest records
Note

The data source database management system determines the accepted statements and supported syntax. if the Pre-SQL statement fails during a load job, the object data extraction and loading fail and an error message appears. Logs also will contain the failure reason.