{"id":29676,"date":"2025-10-21T06:16:45","date_gmt":"2025-10-21T13:16:45","guid":{"rendered":"https:\/\/www.pingcap.com\/?p=29676"},"modified":"2025-11-03T07:13:57","modified_gmt":"2025-11-03T15:13:57","slug":"kafka-streaming-data-integrate-with-tidb","status":"publish","type":"post","link":"https:\/\/www.pingcap.com\/ko\/blog\/kafka-streaming-data-integrate-with-tidb\/","title":{"rendered":"How to Stream Data from Kafka to TiDB"},"content":{"rendered":"<p>Modern applications generate enormous amounts of event data with user actions, transactions, logs, and metrics all happening in real time. To handle this scale, many teams rely on&nbsp;<a href=\"https:\/\/www.confluent.io\/what-is-apache-kafka\/\">Apache Kafka<\/a>, a distributed messaging system that decouples applications from their <a href=\"https:\/\/www.pingcap.com\/ko\/article\/optimizing-data-pipelines-with-tidb-for-modern-enterprises\/\">data pipelines<\/a> and ensures reliable, <a href=\"https:\/\/www.pingcap.com\/ko\/article\/boost-business-with-real-time-big-data-analytics-using-tidb\/#:~:text=TiDB%20is%20engineered%20to%20deliver,and%20significantly%20reducing%20response%20times.\">high-throughput data delivery<\/a>.<\/p>\n\n\n\n<p>On the storage side,&nbsp;TiDB&nbsp;provides a distributed SQL database that scales horizontally, handles both transactional and analytical queries, and maintains <a href=\"https:\/\/www.pingcap.com\/ko\/article\/boost-trading-performance-with-low-latency-solutions\/#:~:text=At%20the%20heart%20of%20TiDB's,not%20slow%20down%20read%20queries.\">low-latency performance<\/a> even under heavy load.<\/p>\n\n\n\n<p>Together, Kafka and TiDB form a powerful foundation for real-time workloads where high write throughput and <a href=\"https:\/\/www.pingcap.com\/ko\/article\/mastering-real-time-data-processing-with-tidb-key-insights\/\">fast data processing<\/a> are critical.<\/p>\n\n\n\n<p>This two-part blog tutorial explores how to integrate Kafka with TiDB.&nbsp;Part 1&nbsp;covers the basics around how to stream data from Kafka to TiDB and why this architecture is becoming increasingly popular.&nbsp;Part 2&nbsp;will examine how TiDB performs when Kafka processes millions of messages per second and how to monitor <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/performance-tuning-overview\">TiDB\u2019s internal performance<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Stream_Data_through_Kafka\"><\/span><strong>Why Stream Data through Kafka?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>A recent customer project involved an application that <a href=\"https:\/\/developers.redhat.com\/learning\/learn:apache-kafka:kafka-101\/resource\/resources:what-are-messages\">sent messages<\/a> directly to Kafka. From Kafka, data flowed into a persistent storage layer that included systems such as SQL Server and Cassandra.<\/p>\n\n\n\n<p>This design choice is common for systems that handle large volumes of writes. Sending data directly to a database under heavy load can lead to latency issues, slowing down the entire application. Kafka helps mitigate this by acting as a&nbsp;buffer between the application and the database, ensuring that high-frequency writes are first collected and processed asynchronously before reaching the storage layer.<\/p>\n\n\n\n<p>By decoupling ingestion from persistence, Kafka maintains consistent performance and reliability even during spikes in traffic.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"365\" src=\"https:\/\/static.pingcap.com\/files\/2025\/09\/24045155\/image-4-1024x365.png\" alt=\"How Kafka decouples application data streams.\" class=\"wp-image-29677\" srcset=\"https:\/\/static.pingcap.com\/files\/2025\/09\/24045155\/image-4-1024x365.png 1024w, https:\/\/static.pingcap.com\/files\/2025\/09\/24045155\/image-4-300x107.png 300w, https:\/\/static.pingcap.com\/files\/2025\/09\/24045155\/image-4-768x274.png 768w, https:\/\/static.pingcap.com\/files\/2025\/09\/24045155\/image-4-1536x547.png 1536w, https:\/\/static.pingcap.com\/files\/2025\/09\/24045155\/image-4.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\"><em>Fig. 1: How Kafka decouples application data streams<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_TiDB\"><\/span><strong>What is TiDB?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>TiDB&nbsp;is an open-source, <a href=\"https:\/\/www.pingcap.com\/ko\/blog\/why-distributed-sql-databases-elevate-modern-app-dev\/\">distributed SQL database<\/a> designed for horizontal scalability, strong consistency, and high availability. It uses a&nbsp;decoupled compute and storage architecture, allowing each layer to scale independently \u2014 a key advantage for cost and performance optimization.<\/p>\n\n\n\n<p>TiDB is&nbsp;<a href=\"https:\/\/www.pingcap.com\/ko\/blog\/acid-at-scale-why-mysql-needs-distributed-sql-alternative\/\">MySQL \ud638\ud658<\/a>, which means existing applications, drivers, and SQL syntax can often be reused with minimal modification. This compatibility also makes it easier to migrate from other databases such as MySQL, PostgreSQL, or MongoDB.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"310\" src=\"https:\/\/static.pingcap.com\/files\/2025\/09\/24045156\/image-5-1024x310.png\" alt=\"How TiDB complements Kafka for unified workloads.\" class=\"wp-image-29678\" srcset=\"https:\/\/static.pingcap.com\/files\/2025\/09\/24045156\/image-5-1024x310.png 1024w, https:\/\/static.pingcap.com\/files\/2025\/09\/24045156\/image-5-300x91.png 300w, https:\/\/static.pingcap.com\/files\/2025\/09\/24045156\/image-5-768x233.png 768w, https:\/\/static.pingcap.com\/files\/2025\/09\/24045156\/image-5-1536x466.png 1536w, https:\/\/static.pingcap.com\/files\/2025\/09\/24045156\/image-5.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\"><em>Fig. 2: How TiDB complements Kafka for unified workloads<\/em><\/p>\n\n\n\n<p>Let&#8217;s start with an example from a test TiDB instance running on the cloud:<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ankitkapoor@Ankits-MacBook-Air bin % .\/mysql -uankit -hxxx -P 4000 -p\n\n\nmysql&gt; show databases;\n+--------------------+\n| Database           |\n+--------------------+\n| INFORMATION_SCHEMA |\n| PERFORMANCE_SCHEMA |\n| ankit              |\n| kafka              |\n| mysql              |\n| test               |\n+--------------------+\n6 rows in set (0.10 sec)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_About_TiDB_to_Kafka\"><\/span><strong>What About TiDB to Kafka?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/overview\/\">\ud2f0DB<\/a> can also&nbsp;stream data to Kafka&nbsp;using&nbsp;<a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/ticdc-overview\/\">TiCDC<\/a>, which is documented <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/ticdc-sink-to-kafka\/\">\uc5ec\uae30<\/a>.<\/p>\n\n\n\n<p>TiCDC (TiDB Change Data Capture)&nbsp;is a component that captures real-time changes from TiDB and replicates them downstream. It reads&nbsp;Raft logs, internal records that track every change in the TiDB cluster, and pushes those changes to external systems like Kafka, another TiDB cluster, or cloud storage.<\/p>\n\n\n\n<p>For reference, TiDB <a href=\"https:\/\/www.pingcap.com\/ko\/article\/understanding-tidbs-raft-consensus-for-distributed-databases\/\">Raft log files<\/a> typically look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-rw-r--r--  1 ankitkapoor  cc    69B 11 Sep 02:29 0000000000000001.rewrite\n-rw-r--r--  1 ankitkapoor  cc     0B 11 Sep 02:39 LOCK\n-rw-r--r--  1 ankitkapoor  cc   869K 11 Sep 02:39 0000000000000001.raftlog  &lt;\u2014 Raft log\n<\/code><\/pre>\n\n\n\n<p>While TiCDC handles data from TiDB to Kafka, this article focuses on the reverse,&nbsp;Kafka to TiDB.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Kafka_to_TiDB_Overview\"><\/span>Kafka to TiDB: Overview<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Streaming data from Kafka to TiDB is often achieved using&nbsp;Kafka Connect, an open-source framework for building scalable and reliable data pipelines. While other tools like&nbsp;PySpark&nbsp;can accomplish this, Kafka Connect provides a simpler and more performant approach, especially for production environments.<\/p>\n\n\n\n<p>Since TiDB is MySQL-compatible, existing&nbsp;MySQL JDBC drivers&nbsp;can be used to set up the data stream between Kafka and TiDB.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Requirements<\/strong><\/h3>\n\n\n\n<p>To follow this guide, the following components are required:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Kafka<\/li>\n\n\n\n<li>Zookeeper<\/li>\n\n\n\n<li>Kafka-topics<\/li>\n\n\n\n<li>Kafka-console-producer<\/li>\n\n\n\n<li>Kafka-console-consumer<\/li>\n\n\n\n<li>Kafka Sink connector<\/li>\n\n\n\n<li>MySQL client<\/li>\n\n\n\n<li>TiDB cluster<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Test Environment<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Local machine:&nbsp;<\/strong>MacOS 15.6.1<\/li>\n\n\n\n<li><strong>MySQL client:<\/strong>&nbsp;9.4.0&nbsp;(any recent version will work)<\/li>\n\n\n\n<li><strong>Database:&nbsp;<\/strong><a href=\"https:\/\/tidbcloud.com\/\">TiDB Cloud Serverless<\/a>&nbsp;(publicly available)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What this Blog Won\u2019t Cover<\/strong><\/h3>\n\n\n\n<p>This blog assumes basic familiarity with Kafka fundamentals such as&nbsp;<a href=\"https:\/\/zookeeper.apache.org\/\">Zookeeper<\/a>, <a href=\"https:\/\/developer.confluent.io\/courses\/apache-kafka\/topics\/\">Kafka&nbsp;topics<\/a>, <a href=\"https:\/\/kafka.apache.org\/intro\">messages<\/a>, and&nbsp;streaming concepts. Those topics are well-documented in the official Kafka resources and will not be repeated here.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Getting_Started\"><\/span><strong>Getting Started<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install Kafka<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\u200b\u200bbrew install kafka<\/code><\/pre>\n\n\n\n<p>Expected message:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>To start kafka now and restart at login:\n  brew services start kafka\nOr, if you don't want\/need a background service you can just run:\n  \/opt\/homebrew\/opt\/kafka\/bin\/kafka-server-start \/opt\/homebrew\/etc\/kafka\/server.properties\n<\/code><\/pre>\n\n\n\n<p>For Linux, refer to the <a href=\"https:\/\/kafka.apache.org\/quickstart\">official setup guide<\/a>. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: <strong>Install Zookeeper<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install zookeeper<\/code><\/pre>\n\n\n\n<p>Expected message:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>To start zookeeper now and restart at login:\n  brew services start zookeeper\nOr, if you don't want\/need a background service you can just run:\n  SERVER_JVMFLAGS=\"-Dapple.awt.UIElement=true\" \/opt\/homebrew\/opt\/zookeeper\/bin\/zkServer start-foreground<\/code><\/pre>\n\n\n\n<p>Start Zookeeper:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew services start zookeeper<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: <strong>Download Dependencies<\/strong><\/h3>\n\n\n\n<p>Download the following:<\/p>\n\n\n\n<ul start=\"3\" class=\"wp-block-list\">\n<li><strong>Kafka Connect JDBC:<\/strong>&nbsp;<code><a href=\"https:\/\/www.confluent.io\/hub\/confluentinc\/kafka-connect-jdbc?\">confluentinc-kafka-connect-jdbc-10.8.4<\/a><\/code><\/li>\n\n\n\n<li><strong>MySQL JDBC Connector:<\/strong>&nbsp;<code><a href=\"https:\/\/dev.mysql.com\/downloads\/connector\/j\/\">mysql-connector-j-9.4.0<\/a><\/code><\/li>\n<\/ul>\n\n\n\n<p>Move the MySQL connector JAR into the Confluent library and create two configuration files:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Connect-standalone.properties<\/li>\n\n\n\n<li>Mysql-sink-connector.properties<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Configure Kafka Connect<\/h3>\n\n\n\n<p><strong>connect-standalone.properties<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bootstrap.servers=localhost:9092\n\nkey.converter=org.apache.kafka.connect.json.JsonConverter\n\nvalue.converter=org.apache.kafka.connect.json.JsonConverter\n\nkey.converter.schemas.enable=false\n\nvalue.converter.schemas.enable=false\n\noffset.storage.file.filename=\/tmp\/connect.offsets\n\nplugin.path=\/pathto_sink_jdbc_connector\/<\/code><\/pre>\n\n\n\n<p><strong>mysql-sink-connector.properties<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>name=jdbc-sink\n\nconnector.class=io.confluent.connect.jdbc.JdbcSinkConnector\n\ntasks.max=1\n\ntopics=kafka_to_TiDB ( one which we will be creating later, you can choose your desired name )\n\nconnection.url=jdbc:hostname:4000\/yourdatabase\n\nconnection.user=user_name\n\nconnection.password=password\n\nauto.create=false\n\nauto.evolve=false\n\ninsert.mode=insert\n\npk.mode=none\n\ntable.name.format=tb_kafka_to_TiDB\n\nkey.converter=org.apache.kafka.connect.json.JsonConverter\n\nvalue.converter=org.apache.kafka.connect.json.JsonConverter\n\nkey.converter.schemas.enable=true\n\nvalue.converter.schemas.enable=true\n\ntransforms=filter\n\ntransforms.filter.type=org.apache.kafka.connect.transforms.ReplaceField$Value\n\ntransforms.filter.include=id,user<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: <strong>Create the Target TiDB Table<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE `tb_kafka_to_TiDB` (\n\n&nbsp;&nbsp;`id` int DEFAULT NULL,\n\n&nbsp;&nbsp;`user` char(255) DEFAULT NULL\n\n)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: <strong>Start Kafka Connect &nbsp;<\/strong><\/h3>\n\n\n\n<p>Run the following command in the same directory as the configuration files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>connect-standalone connect-standalone.properties mysql-sink-connector.properties<\/code><\/pre>\n\n\n\n<p><strong>Note: <\/strong>Ensure that this command is run in the same folder where the two configuration files \u2014&nbsp;Connect-standalone.properties&nbsp;and&nbsp;Mysql-sink-connector.properties&nbsp;\u2014 were created.<\/p>\n\n\n\n<p>Successful startup logs will include:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kafka_to_TiDB-0 (org.apache.kafka.clients.consumer.internals.ConsumerRebalanceListenerInvoker:58)\n\n&#91;2025-08-18 19:58:35,603] INFO &#91;jdbc-sink|task-0] &#91;Consumer clientId=connector-consumer-jdbc-sink-0, groupId=connect-jdbc-sink] Found no committed offset for partition kafka_to_TiDB-0 (org.apache.kafka.clients.consumer.internals.ConsumerCoordinator:1508)\n\n&#91;2025-08-18 19:58:35,607] INFO &#91;jdbc-sink|task-0] &#91;Consumer clientId=connector-consumer-jdbc-sink-0, groupId=connect-jdbc-sink] Resetting offset for partition kafka_to_TiDB-0 to position FetchPosition{offset=0, offsetEpoch=Optional.empty, currentLeader=LeaderAndEpoch{leader=Optional&#91;localhost:9092 (id: 1 rack: null isFenced: false)], epoch=0}}. (org.apache.kafka.clients.consumer.internals.SubscriptionState:447)\n\n&#91;2025-08-18 19:58:46,968] INFO &#91;jdbc-sink|task-0] JdbcDbWriter Connected (io.confluent.connect.jdbc.sink.JdbcDbWriter:57)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: <strong>Create and Test a Kafka Topic<\/strong><\/h3>\n\n\n\n<p>Create a topic and start a producer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kafka-console-producer --bootstrap-server localhost:9092 --topic kafka_to_TiDB --property parse.key=false --property \"key.separator=:\"<\/code><\/pre>\n\n\n\n<p>Then, start a consumer to verify message parsing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kafka-console-consumer --bootstrap-server localhost:9092 --topic kafka_to_TiDB --from-beginning\n\nhello\n\nkafka\n\nwhats goin on\n\nman\n\n\"User signed up\"\n\n\"User signed up\"\n\n\"User signed up\"\n\n{\"id\": 123, \"status\": \"active\"}\n\n{\"temperature\": 25.4}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 8: Send Messages to Kafka<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>kafka-console-producer --bootstrap-server localhost:9092 --topic kafka_to_TiDB --property parse.key=false --property \"key.separator=:\"\n\n&gt;{\"schema\":{\"type\":\"struct\",\"fields\":&#91;{\"field\":\"id\",\"type\":\"int32\"},{\"field\":\"user\",\"type\":\"string\"}],\"optional\":false,\"name\":\"kafka_to_TiDB\"},\"payload\":{\"id\":1,\"user\":\"Ankit\"}}<\/code><\/pre>\n\n\n\n<p>The Kafka Connect logs should confirm successful writes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;2025-08-18 19:58:48,424] INFO &#91;jdbc-sink|task-0] Setting metadata for table \"ankit\".\"kafka_to_TiDB\" to Table{name='\"ankit\".\"kafka_to_TiDB\"', type=TABLE columns=&#91;Column{'id', isPrimaryKey=false, allowsNull=true, sqlType=INT}, Column{'user', isPrimaryKey=false, allowsNull=true, sqlType=CHAR}]} (io.confluent.connect.jdbc.util.TableDefinitions:64)\n\n&#91;2025-08-18 19:58:48,725] INFO &#91;jdbc-sink|task-0] Completed write operation for 1 records to the database (io.confluent.connect.jdbc.sink.JdbcDbWriter:100)\n\n&#91;2025-08-18 19:58:48,726] INFO &#91;jdbc-sink|task-0] Successfully wrote 1 records. (io.confluent.connect.jdbc.sink.JdbcSinkTask:91)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Verify_in_TiDB\"><\/span><strong>Verify in TiDB<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Finally, connect to TiDB using the MySQL client:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n.\/mysql -u 'ankit' -hhostname -P 4000 -p<\/code><\/pre>\n\n\n\n<p>Then query the table:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nmysql&gt; select * from ankit.kafka_to_TiDB;\n+------+-------+\n| id   | user  |\n+------+-------+\n|    1 | Ankit |\n+------+-------+<\/code><\/pre>\n\n\n\n<p>You&#8217;ll see that your data was successfully inserted, and Kafka is now streaming events into TiDB.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>By streaming data from Kafka to TiDB, organizations can take advantage of Kafka\u2019s ability to handle massive event throughput while leveraging TiDB\u2019s distributed SQL capabilities for scalable, real-time data processing. This setup helps reduce latency, prevent write bottlenecks, and ensure application performance remains smooth even under demanding workloads.<\/p>\n\n\n\n<p>In&nbsp;Part 2 of this blog tutorial, we&#8217;ll dive into&nbsp;performance testing and observability, exploring how this architecture behaves under millions of messages per second and how to effectively monitor TiDB\u2019s performance.<\/p>\n\n\n\n<p>Want to try this yourself? Experience TiDB in action with&nbsp;<strong><a href=\"https:\/\/docs.pingcap.com\/tidbcloud\/tidb-cloud-quickstart\">the TiDB Cloud Quick Start Lab<\/a><\/strong>. For a deeper dive into distributed SQL, check out the&nbsp;<strong><a href=\"https:\/\/university.pingcap.com\/\">TiDB University Courses<\/a><\/strong> with self-paced modules that cover everything from TiDB fundamentals to advanced performance tuning and real-world streaming integrations.<\/p>","protected":false},"excerpt":{"rendered":"<p>Modern applications generate enormous amounts of event data with user actions, transactions, logs, and metrics all happening in real time. To handle this scale, many teams rely on&nbsp;Apache Kafka, a distributed messaging system that decouples applications from their data pipelines and ensures reliable, high-throughput data delivery. On the storage side,&nbsp;TiDB&nbsp;provides a distributed SQL database that [&hellip;]<\/p>\n","protected":false},"author":320,"featured_media":30231,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[6],"tags":[147,433,432,111],"class_list":["post-29676","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-engineering","tag-distributed-sql","tag-kafka","tag-streaming-data","tag-tidb"],"acf":[],"featured_image_src":"https:\/\/static.pingcap.com\/files\/2025\/10\/03071312\/tidb_feature_1800x600-1-6.png","author_info":{"display_name":"Ankit Kapoor","author_link":"https:\/\/www.pingcap.com\/ko\/blog\/author\/ankit-kapoor\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Kafka Streaming Data: How to Integrate Pipelines with TiDB<\/title>\n<meta name=\"description\" content=\"In this tutorial, learn how to stream data from Kafka to TiDB with Kafka Connect configurations for seamless data insertion.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/kafka-streaming-data-integrate-with-tidb\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kafka Streaming Data: How to Integrate Pipelines with TiDB\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, learn how to stream data from Kafka to TiDB with Kafka Connect configurations for seamless data insertion.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/blog\/kafka-streaming-data-integrate-with-tidb\/\" \/>\n<meta property=\"og:site_name\" content=\"TiDB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pingcap2015\" \/>\n<meta property=\"article:published_time\" content=\"2025-10-21T13:16:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-03T15:13:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2025\/10\/03071333\/tidb_1200x627-2-6.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1254\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ankit Kapoor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/static.pingcap.com\/files\/2025\/10\/03071351\/tidb_twitter_1600x900-3-3.png\" \/>\n<meta name=\"twitter:creator\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:site\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ankit Kapoor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/\"},\"author\":{\"name\":\"Ankit Kapoor\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/8794898dafdf83d7ec6356b7d3804194\"},\"headline\":\"How to Stream Data from Kafka to TiDB\",\"datePublished\":\"2025-10-21T13:16:45+00:00\",\"dateModified\":\"2025-11-03T15:13:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/\"},\"wordCount\":964,\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2025\/10\/03071312\/tidb_feature_1800x600-1-6.png\",\"keywords\":[\"Distributed SQL\",\"Kafka\",\"Streaming Data\",\"TiDB\"],\"articleSection\":[\"Engineering\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/\",\"url\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/\",\"name\":\"Kafka Streaming Data: How to Integrate Pipelines with TiDB\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2025\/10\/03071312\/tidb_feature_1800x600-1-6.png\",\"datePublished\":\"2025-10-21T13:16:45+00:00\",\"dateModified\":\"2025-11-03T15:13:57+00:00\",\"description\":\"In this tutorial, learn how to stream data from Kafka to TiDB with Kafka Connect configurations for seamless data insertion.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#primaryimage\",\"url\":\"https:\/\/static.pingcap.com\/files\/2025\/10\/03071312\/tidb_feature_1800x600-1-6.png\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2025\/10\/03071312\/tidb_feature_1800x600-1-6.png\",\"width\":3600,\"height\":1200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pingcap.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Stream Data from Kafka to TiDB\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pingcap.com\/#website\",\"url\":\"https:\/\/www.pingcap.com\/\",\"name\":\"TiDB\",\"description\":\"TiDB | SQL at Scale\",\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pingcap.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pingcap.com\/#organization\",\"name\":\"PingCAP\",\"url\":\"https:\/\/www.pingcap.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"width\":811,\"height\":232,\"caption\":\"PingCAP\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/pingcap2015\",\"https:\/\/x.com\/PingCAP\",\"https:\/\/linkedin.com\/company\/pingcap\",\"https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/8794898dafdf83d7ec6356b7d3804194\",\"name\":\"Ankit Kapoor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg\",\"caption\":\"Ankit Kapoor\"},\"description\":\"Senior Solution Architect\",\"url\":\"https:\/\/www.pingcap.com\/ko\/blog\/author\/ankit-kapoor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Kafka Streaming Data: How to Integrate Pipelines with TiDB","description":"In this tutorial, learn how to stream data from Kafka to TiDB with Kafka Connect configurations for seamless data insertion.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pingcap.com\/ko\/blog\/kafka-streaming-data-integrate-with-tidb\/","og_locale":"ko_KR","og_type":"article","og_title":"Kafka Streaming Data: How to Integrate Pipelines with TiDB","og_description":"In this tutorial, learn how to stream data from Kafka to TiDB with Kafka Connect configurations for seamless data insertion.","og_url":"https:\/\/www.pingcap.com\/ko\/blog\/kafka-streaming-data-integrate-with-tidb\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_published_time":"2025-10-21T13:16:45+00:00","article_modified_time":"2025-11-03T15:13:57+00:00","og_image":[{"width":2400,"height":1254,"url":"https:\/\/static.pingcap.com\/files\/2025\/10\/03071333\/tidb_1200x627-2-6.png","type":"image\/png"}],"author":"Ankit Kapoor","twitter_card":"summary_large_image","twitter_image":"https:\/\/static.pingcap.com\/files\/2025\/10\/03071351\/tidb_twitter_1600x900-3-3.png","twitter_creator":"@PingCAP","twitter_site":"@PingCAP","twitter_misc":{"Written by":"Ankit Kapoor","Est. reading time":"8\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#article","isPartOf":{"@id":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/"},"author":{"name":"Ankit Kapoor","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/8794898dafdf83d7ec6356b7d3804194"},"headline":"How to Stream Data from Kafka to TiDB","datePublished":"2025-10-21T13:16:45+00:00","dateModified":"2025-11-03T15:13:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/"},"wordCount":964,"publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2025\/10\/03071312\/tidb_feature_1800x600-1-6.png","keywords":["Distributed SQL","Kafka","Streaming Data","TiDB"],"articleSection":["Engineering"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/","url":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/","name":"Kafka Streaming Data: How to Integrate Pipelines with TiDB","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#primaryimage"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2025\/10\/03071312\/tidb_feature_1800x600-1-6.png","datePublished":"2025-10-21T13:16:45+00:00","dateModified":"2025-11-03T15:13:57+00:00","description":"In this tutorial, learn how to stream data from Kafka to TiDB with Kafka Connect configurations for seamless data insertion.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#primaryimage","url":"https:\/\/static.pingcap.com\/files\/2025\/10\/03071312\/tidb_feature_1800x600-1-6.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2025\/10\/03071312\/tidb_feature_1800x600-1-6.png","width":3600,"height":1200},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/blog\/kafka-streaming-data-integrate-with-tidb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"How to Stream Data from Kafka to TiDB"}]},{"@type":"WebSite","@id":"https:\/\/www.pingcap.com\/#website","url":"https:\/\/www.pingcap.com\/","name":"\ud2f0DB","description":"TiDB | SQL at Scale","publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pingcap.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.pingcap.com\/#organization","name":"PingCAP","url":"https:\/\/www.pingcap.com\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/","url":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","width":811,"height":232,"caption":"PingCAP"},"image":{"@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/pingcap2015","https:\/\/x.com\/PingCAP","https:\/\/linkedin.com\/company\/pingcap","https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA"]},{"@type":"Person","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/8794898dafdf83d7ec6356b7d3804194","name":"Ankit Kapoor","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/","url":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","contentUrl":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","caption":"Ankit Kapoor"},"description":"Senior Solution Architect","url":"https:\/\/www.pingcap.com\/ko\/blog\/author\/ankit-kapoor\/"}]}},"grav_blocks":false,"card_markup":"<a class=\"card-resource bg-white\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/kafka-streaming-data-integrate-with-tidb\/\"><div class=\"card-resource__image-container\"><img class=\"card-resource__image\" alt=\"tidb_feature_1800x600 (1)\" src=\"https:\/\/static.pingcap.com\/files\/2025\/10\/03071312\/tidb_feature_1800x600-1-6.png\" loading=\"lazy\" width=3600 height=1200 \/><\/div><div class=\"card-resource__content-container\"><div class=\"card-resource__content-head\"><div class=\"card-resource__category\">Engineering<\/div><\/div><h5 class=\"card-resource__title\">How to Stream Data from Kafka to TiDB<\/h5><\/div><\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/29676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/users\/320"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/comments?post=29676"}],"version-history":[{"count":17,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/29676\/revisions"}],"predecessor-version":[{"id":30046,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/29676\/revisions\/30046"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media\/30231"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=29676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/categories?post=29676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/tags?post=29676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}