{"id":26350,"date":"2026-09-18T13:50:50","date_gmt":"2026-09-18T20:50:50","guid":{"rendered":"https:\/\/www.pingcap.com\/?post_type=article&#038;p=26350"},"modified":"2026-09-18T13:52:39","modified_gmt":"2026-09-18T20:52:39","slug":"mastering-real-time-stream-processing-with-tidb","status":"publish","type":"article","link":"https:\/\/www.pingcap.com\/ko\/article\/mastering-real-time-stream-processing-with-tidb\/","title":{"rendered":"Mastering Real-Time Stream Processing with TiDB"},"content":{"rendered":"<p class=\"wp-block-paragraph\">A fraud-detection model or a dynamic pricing engine is only as good as its freshest data point; if a pipeline batches updates every few minutes, decisions get made on stale information. Real-time stream processing closes that gap by acting on data the moment it changes, and <a href=\"https:\/\/www.pingcap.com\/ko\/what-is-tidb\/\">\ud2f0DB<\/a> feeds that pipeline directly through TiCDC, its built-in change data capture component. This piece covers how that connection works and what to watch when you&#8217;re running it at scale.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_Does_TiDB_Handle_Real-Time_Stream_Processing\"><\/span><strong>How Does TiDB Handle Real-Time Stream Processing?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">TiDB streams data changes to downstream systems through <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/ticdc-overview\">TiCDC<\/a>, a change data capture component that reads row-level updates from TiKV and pushes them to Kafka, from which Apache Flink or another stream processor picks them up. This removes the need for a separate polling job or ETL script to detect what changed since the last read.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_TiDBs_Changefeed_Architecture_Solves_Streaming_Consistency\"><\/span><strong>How TiDB&#8217;s Changefeed Architecture Solves Streaming Consistency<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A polling-based pipeline risks missing updates between poll intervals, or double-processing rows if a poll overlaps with a write. TiCDC avoids both by capturing changes directly from TiKV&#8217;s replication log as they commit, in order, rather than re-scanning tables on a timer. A changefeed configuration tells TiCDC which tables to watch and which Kafka topic to publish to; Flink then consumes that topic to run the actual stream processing logic, whether that&#8217;s aggregation, enrichment, or triggering an action.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.pingcap.com\/ko\/case-study\/mnc-bank-supercharges-performance-with-tidb\/\">MNC Bank<\/a> uses this pipeline to keep downstream fraud and risk systems working from current transaction data instead of a batch that&#8217;s already minutes old by the time it lands.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Setting up a changefeed is a matter of pointing it at the tables to watch and the Kafka topic to publish to; TiCDC handles the ordering and delivery guarantees from there. Each changefeed tracks its own replication checkpoint, so if a downstream consumer falls behind or restarts, it resumes from that checkpoint instead of missing changes or reprocessing the entire table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Performance_Optimization_for_Streaming_Workloads\"><\/span><strong>Performance Optimization for Streaming Workloads<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Improving throughput and reducing latency starts with efficient query execution and caching. TiDB&#8217;s execution plan cache cuts down compile time for repeated queries, which matters when a changefeed is triggering the same query shapes repeatedly. The <a href=\"https:\/\/docs.pingcap.com\/tidb\/v8.2\/performance-tuning-practices\">TiDB Dashboard<\/a> gives visibility into system performance, and its Continuous Profiling view shows CPU and memory consumption so you can tune resource allocation against real load rather than guesswork.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Horizontal scalability lets TiDB adjust node count as changefeed volume grows, and <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/tiflash-overview\">TiFlash<\/a> handles concurrent analytical queries on the same data without competing with the transactional writes the changefeed is capturing. For high-throughput tables, splitting a single changefeed into multiple changefeeds scoped to different table groups spreads replication load across more TiCDC nodes instead of funneling every change through one process.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"FAQ\"><\/span><strong>\uc790\uc8fc \ubb3b\ub294 \uc9c8\ubb38<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What is TiCDC and how does it work with TiDB?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>TiCDC is TiDB&#8217;s built-in change data capture component<\/li>\n\n\n\n<li>It reads row-level changes directly from TiKV&#8217;s replication log<\/li>\n\n\n\n<li>Changes publish to a Kafka topic through a configured changefeed<\/li>\n\n\n\n<li>Downstream tools like Flink consume that topic for processing<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Can TiDB stream data to Kafka in real time?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Yes, TiCDC pushes committed changes to Kafka as they happen<\/li>\n\n\n\n<li>No separate polling job or ETL script is required<\/li>\n\n\n\n<li>Changes stream in commit order, not on a fixed timer<\/li>\n\n\n\n<li>Kafka acts as the buffer between TiDB and downstream consumers<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Does streaming data into TiDB affect transactional performance?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>TiCDC reads from the replication log, not the primary write path<\/li>\n\n\n\n<li>TiFlash handles concurrent analytical queries separately from TiKV&#8217;s transactional load<\/li>\n\n\n\n<li>The execution plan cache reduces repeated query compile time<\/li>\n\n\n\n<li>Horizontal scaling adds capacity if changefeed volume grows<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What&#8217;s the difference between this page and TiDB&#8217;s other real-time processing content?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This page focuses specifically on TiCDC changefeed mechanics<\/li>\n\n\n\n<li>Other PingCAP articles cover IoT, high-frequency trading, and event-driven framings of similar underlying architecture<\/li>\n\n\n\n<li>Start here if you need the Kafka\/Flink integration details specifically<\/li>\n\n\n\n<li>See the TiDB architecture guide for the broader system design<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Streaming_Data_Without_a_Separate_Pipeline_to_Maintain\"><\/span><strong>Streaming Data Without a Separate Pipeline to Maintain<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">TiCDC removes the polling and ETL layer a real-time pipeline usually needs, streaming committed changes straight from TiKV into Kafka and Flink. <a href=\"https:\/\/tidbcloud.com\/free-trial\/\">Start a free TiDB Cloud Starter cluster<\/a> to configure a changefeed against your own workload.<\/p>","protected":false},"excerpt":{"rendered":"<p>Discover how TiDB enhances real-time stream processing with low latency and high scalability for modern data-driven applications.<\/p>","protected":false},"author":305,"featured_media":0,"template":"","class_list":["post-26350","article","type-article","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Mastering Real-Time Stream Processing with TiDB | TiDB Real-Time Stream Processing with TiDB and Kafka<\/title>\n<meta name=\"description\" content=\"Discover how TiDB enhances real-time stream processing with low latency and high scalability for modern data-driven applications. Connect TiDB to Kafka and Flink for real-time stream processing using TiCDC change feeds, with a look at latency and scaling.\" \/>\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\/article\/mastering-real-time-stream-processing-with-tidb\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mastering Real-Time Stream Processing with TiDB | TiDB Real-Time Stream Processing with TiDB and Kafka\" \/>\n<meta property=\"og:description\" content=\"Discover how TiDB enhances real-time stream processing with low latency and high scalability for modern data-driven applications. Connect TiDB to Kafka and Flink for real-time stream processing using TiCDC change feeds, with a look at latency and scaling.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/article\/mastering-real-time-stream-processing-with-tidb\/\" \/>\n<meta property=\"og:site_name\" content=\"TiDB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pingcap2015\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-18T20:52:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2024\/09\/11005522\/Homepage-Ad.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1440\" \/>\n\t<meta property=\"og:image:height\" content=\"714\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:label1\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data1\" content=\"3\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/mastering-real-time-stream-processing-with-tidb\\\/\",\"url\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/mastering-real-time-stream-processing-with-tidb\\\/\",\"name\":\"Mastering Real-Time Stream Processing with TiDB | TiDB Real-Time Stream Processing with TiDB and Kafka\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#website\"},\"datePublished\":\"2026-09-18T20:50:50+00:00\",\"dateModified\":\"2026-09-18T20:52:39+00:00\",\"description\":\"Discover how TiDB enhances real-time stream processing with low latency and high scalability for modern data-driven applications. Connect TiDB to Kafka and Flink for real-time stream processing using TiCDC change feeds, with a look at latency and scaling.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/mastering-real-time-stream-processing-with-tidb\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pingcap.com\\\/article\\\/mastering-real-time-stream-processing-with-tidb\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/mastering-real-time-stream-processing-with-tidb\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pingcap.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Mastering Real-Time Stream Processing with 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\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mastering Real-Time Stream Processing with TiDB | TiDB Real-Time Stream Processing with TiDB and Kafka","description":"Discover how TiDB enhances real-time stream processing with low latency and high scalability for modern data-driven applications. Connect TiDB to Kafka and Flink for real-time stream processing using TiCDC change feeds, with a look at latency and scaling.","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\/article\/mastering-real-time-stream-processing-with-tidb\/","og_locale":"ko_KR","og_type":"article","og_title":"Mastering Real-Time Stream Processing with TiDB | TiDB Real-Time Stream Processing with TiDB and Kafka","og_description":"Discover how TiDB enhances real-time stream processing with low latency and high scalability for modern data-driven applications. Connect TiDB to Kafka and Flink for real-time stream processing using TiCDC change feeds, with a look at latency and scaling.","og_url":"https:\/\/www.pingcap.com\/ko\/article\/mastering-real-time-stream-processing-with-tidb\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_modified_time":"2026-09-18T20:52:39+00:00","og_image":[{"width":1440,"height":714,"url":"https:\/\/static.pingcap.com\/files\/2024\/09\/11005522\/Homepage-Ad.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@PingCAP","twitter_misc":{"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/article\/mastering-real-time-stream-processing-with-tidb\/","url":"https:\/\/www.pingcap.com\/article\/mastering-real-time-stream-processing-with-tidb\/","name":"Mastering Real-Time Stream Processing with TiDB | TiDB Real-Time Stream Processing with TiDB and Kafka","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"datePublished":"2026-09-18T20:50:50+00:00","dateModified":"2026-09-18T20:52:39+00:00","description":"Discover how TiDB enhances real-time stream processing with low latency and high scalability for modern data-driven applications. Connect TiDB to Kafka and Flink for real-time stream processing using TiCDC change feeds, with a look at latency and scaling.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/article\/mastering-real-time-stream-processing-with-tidb\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/article\/mastering-real-time-stream-processing-with-tidb\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/article\/mastering-real-time-stream-processing-with-tidb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"Articles","item":"https:\/\/www.pingcap.com\/article\/"},{"@type":"ListItem","position":3,"name":"Mastering Real-Time Stream Processing with 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"]}]}},"card_markup":"        <a class=\"card-article\" href=\"https:\/\/www.pingcap.com\/ko\/article\/mastering-real-time-stream-processing-with-tidb\/\">            <h3>Mastering Real-Time Stream Processing with TiDB<\/h3>            <p>Discover how TiDB enhances real-time stream processing with low latency and high scalability for modern data-driven applications.<\/p>        <\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/article\/26350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/users\/305"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=26350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}