Skip to main content
Last updated on

Flink Doris Connector

Flink Doris Connector reads from and writes to a Doris cluster through Flink, and integrates Flink CDC to conveniently complete full-database synchronization from upstream databases such as MySQL.

Capabilities

CapabilityDescriptionTypical scenarios
Reading Data from DorisReads from BEs in parallel without routing data through FE; supports the Thrift and Arrow Flight SQL protocolsUsing a Doris table as the input of a Flink job, bulk export
Incremental Reading with Doris BinlogContinuously consumes the row-level changes (insert, update, delete) of a table, optionally starting from a snapshot; requires Connector 26.3.0+ and Doris 5.0.0+Syncing the changes of a Doris table to downstream systems in real time
Writing Data to DorisBatches data in Flink and writes it through Stream Load; offers streaming write (Checkpoint-based, Exactly-Once), batch write, and S3 TVF writeReal-time ingestion, landing CDC changes, partial column updates
Lookup JoinBatches upstream records and queries the Doris dimension table asynchronouslyEnriching streams with dimension data
Full-Database SyncIntegrates Flink CDC to sync an entire MySQL, Oracle, PostgreSQL, SQLServer, DB2, or MongoDB database with one command, creating tables and syncing DDL automaticallySyncing business databases to Doris in real time

All capabilities are available through FlinkSQL; reading and writing are also available through the DataStream API. See Connection Options and TLS for connection settings and Data Type Mapping for how Doris and Flink types correspond.

How It Works

FlinkConnectorPrinciples-JDBC-Doris

  • Read: The Connector obtains the Tablet information of the query plan from FE, then reads data from the BEs directly and in parallel. Data does not flow through FE, which avoids the bottleneck of reading and writing serially on a single FE node through JDBC. See Read Principle.
  • Write: Data is batched in Flink memory and then bulk-loaded into Doris through Stream Load. By default, writes follow Flink Checkpoints and use two-phase commit to guarantee Exactly-Once; a batch write mode that does not depend on Checkpoints is also available. See Write Modes.
  • Lookup Join: Upstream records are batched and the Doris dimension table is queried asynchronously, instead of one point query per record.
  • Full-database sync: Changes are read from the upstream database with Flink CDC and written through the Doris Sink, which creates the target tables and syncs Schema Changes automatically.

Version Notes

Connector VersionFlink VersionDoris VersionJava VersionScala Version
1.0.31.11,1.12,1.13,1.140.15+82.11,2.12
1.1.11.141.0+82.11,2.12
1.2.11.151.0+8-
1.3.01.161.0+8-
1.4.01.15 - 1.171.0+8-
1.5.21.15 - 1.181.0+8-
1.6.11.15 - 1.191.0+8-
24.0.11.15 - 1.201.0+8-
24.1.01.15 - 1.201.0+8-
25.0.01.15 - 1.201.0+8-
25.1.01.15 - 1.201.0+8-
26.0.01.15 - 1.20,2.0 - 2.21.0+8(1.x),17(2.x)-
26.1.11.15 - 1.20,2.0 - 2.21.0+8(1.x),17(2.x)-
26.2.01.15 - 1.20,2.0 - 2.21.0+8(1.x),17(2.x)-

Installation

Both Jar package and Maven dependency methods are supported.

Jar Package Method

You can download the Flink Doris Connector Jar package of the corresponding version from the Doris download page and copy it to Flink's classpath:

  • Standalone mode: Place the Jar file under the lib/ directory.
  • Yarn cluster mode: Place the Jar file in the pre-deployment package.

Maven Dependency Method

Add the following dependency to the project's pom.xml:

<dependency>
<groupId>org.apache.doris</groupId>
<artifactId>flink-doris-connector-${flink.version}</artifactId>
<version>${connector.version}</version>
</dependency>

For example:

<dependency>
<groupId>org.apache.doris</groupId>
<artifactId>flink-doris-connector-1.16</artifactId>
<version>26.2.0</version>
</dependency>

Next Steps

  • Follow the Quick Start to read and write a Doris table with FlinkSQL.
  • Check the FAQ first when you hit an error.