All Projects → ververica → Flink Cdc Connectors

ververica / Flink Cdc Connectors

Licence: apache-2.0
Change Data Capture (CDC) Connectors for Apache Flink

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Flink Cdc Connectors

Ragtime
Database-independent migration library
Stars: ✭ 519 (-4.95%)
Mutual labels:  database
Opencypher
Specification of the Cypher property graph query language
Stars: ✭ 534 (-2.2%)
Mutual labels:  database
Imposm3
Imposm imports OpenStreetMap data into PostGIS
Stars: ✭ 542 (-0.73%)
Mutual labels:  database
Ozzo Dbx
A Go (golang) package that enhances the standard database/sql package by providing powerful data retrieval methods as well as DB-agnostic query building capabilities.
Stars: ✭ 523 (-4.21%)
Mutual labels:  database
Cosette
Cosette is an automated SQL solver.
Stars: ✭ 533 (-2.38%)
Mutual labels:  database
Bustub
The BusTub Relational Database Management System (Educational)
Stars: ✭ 534 (-2.2%)
Mutual labels:  database
Citus
Distributed PostgreSQL as an extension
Stars: ✭ 5,580 (+921.98%)
Mutual labels:  database
Couchdb
Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
Stars: ✭ 5,166 (+846.15%)
Mutual labels:  database
Pgaudit
PostgreSQL Audit Extension
Stars: ✭ 532 (-2.56%)
Mutual labels:  database
Go Sqlbuilder
A flexible and powerful SQL string builder library plus a zero-config ORM.
Stars: ✭ 539 (-1.28%)
Mutual labels:  database
Firebird
Firebird server, client and tools
Stars: ✭ 522 (-4.4%)
Mutual labels:  database
Laravel Eloquent Query Cache
Adding cache on your Laravel Eloquent queries' results is now a breeze.
Stars: ✭ 529 (-3.11%)
Mutual labels:  database
Nitrite Java
Java embedded nosql document store
Stars: ✭ 538 (-1.47%)
Mutual labels:  database
Qb
The database toolkit for go
Stars: ✭ 524 (-4.03%)
Mutual labels:  database
Lmdbjava
Lightning Memory Database (LMDB) for Java: a low latency, transactional, sorted, embedded, key-value store
Stars: ✭ 546 (+0%)
Mutual labels:  database
Chat
基于自然语言理解与机器学习的聊天机器人,支持多用户并发及自定义多轮对话
Stars: ✭ 516 (-5.49%)
Mutual labels:  database
Kakapo.js
🐦 Next generation mocking framework in Javascript
Stars: ✭ 535 (-2.01%)
Mutual labels:  database
Typeorm
ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
Stars: ✭ 26,559 (+4764.29%)
Mutual labels:  database
Entityauditbundle
Audit for Doctrine Entities
Stars: ✭ 546 (+0%)
Mutual labels:  database
Corfudb
A cluster consistency platform
Stars: ✭ 539 (-1.28%)
Mutual labels:  database

Flink CDC Connectors

Flink CDC Connectors is a set of source connectors for Apache Flink, ingesting changes from different databases using change data capture (CDC). The Flink CDC Connectors integrates Debezium as the engine to capture data changes. So it can fully leverage the ability of Debezium. See more about what is Debezium.

This README is meant as a brief walkthrough on the core features with Flink CDC Connectors. For a fully detailed documentation, please see Documentation.

Supported (Tested) Connectors

Database Version
MySQL Database: 5.7, 8.0.x
JDBC Driver: 8.0.16
PostgreSQL Database: 9.6, 10, 11, 12
JDBC Driver: 42.2.12

Features

  1. Supports reading database snapshot and continues to read binlogs with exactly-once processing even failures happen.
  2. CDC connectors for DataStream API, users can consume changes on multiple databases and tables in a single job without Debezium and Kafka deployed.
  3. CDC connectors for Table/SQL API, users can use SQL DDL to create a CDC source to monitor changes on a single table.

Usage for Table/SQL API

We need several steps to setup a Flink cluster with the provided connector.

  1. Setup a Flink cluster with version 1.12+ and Java 8+ installed.
  2. Download the connector SQL jars from the Download page (or build yourself.
  3. Put the downloaded jars under FLINK_HOME/lib/.
  4. Restart the Flink cluster.

The example shows how to create a MySQL CDC source in Flink SQL Client and execute queries on it.

-- creates a mysql cdc table source
CREATE TABLE mysql_binlog (
 id INT NOT NULL,
 name STRING,
 description STRING,
 weight DECIMAL(10,3)
) WITH (
 'connector' = 'mysql-cdc',
 'hostname' = 'localhost',
 'port' = '3306',
 'username' = 'flinkuser',
 'password' = 'flinkpw',
 'database-name' = 'inventory',
 'table-name' = 'products'
);

-- read snapshot and binlog data from mysql, and do some transformation, and show on the client
SELECT id, UPPER(name), description, weight FROM mysql_binlog;

Usage for DataStream API

Include following Maven dependency (available through Maven Central):

<dependency>
  <groupId>com.alibaba.ververica</groupId>
  <!-- add the dependency matching your database -->
  <artifactId>flink-connector-mysql-cdc</artifactId>
  <version>1.2.0</version>
</dependency>
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.source.SourceFunction;
import com.alibaba.ververica.cdc.debezium.StringDebeziumDeserializationSchema;
import com.alibaba.ververica.cdc.connectors.mysql.MySQLSource;

public class MySqlBinlogSourceExample {
  public static void main(String[] args) throws Exception {
    SourceFunction<String> sourceFunction = MySQLSource.<String>builder()
      .hostname("localhost")
      .port(3306)
      .databaseList("inventory") // monitor all tables under inventory database
      .username("flinkuser")
      .password("flinkpw")
      .deserializer(new StringDebeziumDeserializationSchema()) // converts SourceRecord to String
      .build();

    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

    env
      .addSource(sourceFunction)
      .print().setParallelism(1); // use parallelism 1 for sink to keep message ordering

    env.execute();
  }
}

Building from source

Prerequisites:

  • git
  • Maven
  • At least Java 8
git clone https://github.com/ververica/flink-cdc-connectors.git
cd flink-cdc-connectors
mvn clean install -DskipTests

Flink CDC Connectors is now available at your local .m2 repository.

License

The code in this repository is licensed under the Apache Software License 2.

Contributing

The Flink CDC Connectors welcomes anyone that wants to help out in any way, whether that includes reporting problems, helping with documentation, or contributing code changes to fix bugs, add tests, or implement new features. You can report problems to request features in the GitHub Issues.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].