Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

A separate database plugin to support MySQL-specific features and configurations.

Use-Case

  • Users can choose and install MySQL source and sink plugins.
  • Users should see MySQL logo on plugin configuration page for better experience.
  • Users should get relevant information from the tool tip:
    • The tool tip for the connection string should be customized specifically to the MySQL database,
    • The tool tip should describe accurately what each field is used for.
  • User should get a performance comparable to Sqoop by utilizing sqoop libraries for the data ingestion and egress.
  • Users should not have to specify any redundant configuration (ex: JDBC type in source plugin, columns in the sink plugin).
  • Users should get field level lineage for the source and sink that is being used.
  • Reference documentation should be updated to account for the changes.
  • The source code for MySQL database plugin should be placed in repo under data-integrations org.
  • Integration tests for MySQL database plugin should be added in the test repo.
  • The data pipeline using source and sink plugins should run on both mapreduce and spark engines.

User Stories

  • User should be able to install MySQL specific database source and sink plugins from the Hub
  • Users should have each tool tip accurately describe what each field does
  • Users should know the format for the MySql connection string by hovering over tool tip for connection string
  • Users should get field level lineage information for the MySQL source and sink 
  • Users should get a performance comparable to Sqoop when ingesting data from mysql and while writing data to MySQL (within ~15% of the time taken for sqoop)
  • Users should be able to setup a pipeline avoiding specifying redundant information
  • Users should get updated reference document for MySQL source and sink
  • Users should be able to read all the DB types

Plugin Type

  • Batch Source
  • Batch Sink 
  • Real-time Source
  • Real-time Sink
  • Action
  • Post-Run Action
  • Aggregate
  • Join
  • Spark Model
  • Spark Compute

Design Tips

MySQL Connector/J 8.0 reference: https://dev.mysql.com/doc/connector-j/8.0/en/

Existing database plugins: https://github.com/cdapio/hydrator-plugins/tree/develop/database-plugins

MySQL datatypes mappings and conversions: https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-type-conversions.html

Design

Currently the two major MySQL versions supported are 5 and 8. We suggest using MySQL Connector/J 8.0 since it is backward compatible with older versions of MySQL and supports all the new features of recent releases.

The suggestion is to move database-plugins module from hydrator-plugins repository to database-plugins repo in data-integrations organization as described in Plugins Repo Split. There is existing code in database-plugins that may be reused for MySQL plugin. We suggest creating a multi-module Maven project where existing `database-plugins` will be a common functionality module for all subsequent DB plugins and each plugin for a specific database (in this case MySQL) will depend on it. Having each DB plugin in a dedicated module allows us to create separately deliverable artifacts, so user can upload only those plugins they need.

Sink Properties

User Facing NameTypeDescriptionConstraints
LabelString Label for UI
Reference NameStringUniquely identified name for lineage
HostStringMysql hostRequired (defaults to localhost on UI)
PortNumberSpecific port where mysql running on

Optional

(default 3306)

DatabaseStringDatabase name to connectRequired
Import QueryStringQuery for import dataValid SQL query
UsernameStringDB usernameRequired
PasswordPasswordUser passwordRequired
Bounding QueryStringReturns max and min of split-By FiledValid SQL query
Split-By Field NameStringField name which will be used to generate splits
Number of Splits to GenerateNumberNumber of splits to generate
Transaction Isolation LevelSelectTransaction isolation level for queries run by this sink
Connection ArgumentsKeyvalue

A list of arbitrary string tag/value pairs as connection arguments, list of properties

https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-configuration-properties.html


Table NameStringName of a database table to write to

Source Properties


User Facing NameTypeDescriptionConstraints
LabelStringLabel for UI
Reference NameStringUniquely identified name for lineage
HostStringMysql hostRequired (defaults to localhost on UI)
PortNumberSpecific port where mysql running on

Optional

(default 3306)
DatabaseStringDatabase name to connectRequired
Import QueryStringQuery for import dataValid SQL query
UsernameStringDB usernameRequired
PasswordStringUser passwordRequired
Bounding QueryStringReturns max and min of split-By FiledValid SQL query
Split-By Field NameStringField name which will be used to generate splits
Number of Splits to GenerateNumberNumber of splits to generate
Transaction Isolation LevelSelectTransaction isolation level for queries run by this sink
Connection ArgumentsKeyvalueA list of arbitrary string tag/value pairs as connection arguments, list of properties https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-configuration-properties.html


Action Properties


User Facing NameTypeDescriptionConstraints
LabelStringLabel for UI
HostStringMysql hostRequired (defaults to localhost on UI)
PortNumberSpecific port where mysql running on

Optional

(default 3306)
DatabaseStringDatabase name to connectRequired
Username

String

DB usernameRequired
PasswordStringUser passwordRequired
Connection ArgumentsKeyvalueA list of arbitrary string tag/value pairs as connection arguments, list of properties https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-configuration-properties.html
Database CommandStringDatabase command to runValid SQL query



Approach

Create a module mysql-plugin in database-plugins project, reuse existing database-plugins code if possible. Add MySQL-specific properties to configuration, add support for MySQL-specific datatypes. Update UI widgets JSON definitions.

Pipeline Samples

CampaignPipeline-cdap-data-pipeline.json


API changes

Deprecated Programmatic APIs

database-plugins is moved to Data Integrations

UI Impact or Changes

Configurable database properties are presented as named text fields instead of arbitrary key value pairs. MySQL source and sink are separate entries with MySQL logo in source and sink lists.

Test Scenarios

TODO

Releases

Release X.Y.Z

Related Work

Database plugin enhancements

Future work

PostgreSQL database plugin

  • No labels