MySQL

MySQL is a popular open source object-relational database system.

Features

FeatureSupported
Batch Mode
Stream Mode
Deduplication
Queries Optimization

Configuration

Advanced: Implementation Details

This section describes how Jitsu implements various modes and features for Mysql.

Batch Mode

Algorithm
-- Jitsu collects events batches in tmp file on file system.
BEGIN -- start transaction
INSERT into tmp_table -- load tmp file into tmp_table
INSERT into target_table select from tmp_table
COMMIT -- commit transaction

Stream Mode

INSERT INTO target_table (...) VALUES (..)

Deduplication

For batch mode the following algorithm is used:

Algorithm
-- Jitsu collects events batches in tmp file on file system.
-- Deduplicate rows in tmp file
BEGIN -- start transaction
INSERT into tmp_table ... ON DUPLICATE KEY UPDATE ... -- load tmp file into tmp_table
INSERT into target_table select from tmp_table ... ON DUPLICATE KEY UPDATE ...
COMMIT -- commit transaction

For stream mode:

INSERT INTO target_table ... ON DUPLICATE KEY UPDATE ...

Queries Optimization

Timestamp connection setting is used to optimize SELECT queries.

Regular index is created on specified timestamp column.