{"id":27713,"date":"2025-06-02T13:13:43","date_gmt":"2025-06-02T20:13:43","guid":{"rendered":"https:\/\/www.pingcap.com\/?post_type=article&#038;p=27713"},"modified":"2025-06-02T13:13:44","modified_gmt":"2025-06-02T20:13:44","slug":"the-hard-parts-of-distributed-databases-and-how-to-solve-them","status":"publish","type":"article","link":"https:\/\/www.pingcap.com\/ko\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/","title":{"rendered":"The Hard Parts of Distributed Databases (and How to Solve Them)"},"content":{"rendered":"<p>Distributed databases power the modern world\u2014but they\u2019re not without their challenges. From unpredictable network partitions to latency spikes and complex schema upgrades, these issues are more than just technical headaches\u2014they determine whether your system will scale or stall.<\/p>\n\n\n\n<p>In this guide, we\u2019ll unpack the\u00a0<strong>core challenges in distributed database design<\/strong>, explain how the\u00a0<strong>CAP theorem<\/strong> influences real-world trade-offs, and show how\u00a0<strong>TiDB addresses these challenges<\/strong>\u00a0with a modern, developer-friendly architecture.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Network_Partitions_Latency_and_Failover\"><\/span><strong>Network Partitions, Latency, and Failover<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><span style=\"font-size: revert; white-space: normal;\">In any distributed system,\u00a0<b>network partitions<\/b>\u00a0aren\u2019t a rare event\u2014they\u2019re a guarantee. Whether due to hardware failures, cloud outages, or simple configuration errors, partitions isolate parts of the cluster and test the system\u2019s ability to maintain availability and data integrity.<\/span><p class=\"p2\" style=\"white-space: normal;\"><\/p><p class=\"p1\" style=\"white-space: normal;\"><span class=\"s1\"><b>TiDB addresses these distributed system tradeoffs head-on<\/b><\/span>. Using the <a href=\"https:\/\/www.pingcap.com\/ko\/article\/understanding-raft-consensus-in-distributed-systems-with-tidb\/\">Raft consensus algorithm<\/a>, TiDB ensures that even when nodes are isolated, a majority can still elect a leader and proceed with operations\u2014preserving\u00a0<span class=\"s1\"><b>consistency<\/b><\/span>\u00a0\uadf8\ub9ac\uace0\u00a0<span class=\"s1\"><b>partition tolerance<\/b><\/span>.<\/p><p class=\"p2\" style=\"white-space: normal;\"><\/p><p class=\"p1\" style=\"white-space: normal;\">To reduce\u00a0<span class=\"s1\"><b>latency<\/b><\/span>, TiDB applies intelligent data placement and locality-aware scheduling. This means queries stay close to where data lives, minimizing cross-region lag. And when failure strikes, TiDB\u2019s\u00a0<span class=\"s1\"><b>automated failover<\/b><\/span>\u00a0quickly reassigns leaders and restores balance\u2014ensuring that your application stays online.<\/p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Understanding_the_CAP_Theorem_in_Practice\"><\/span><p class=\"p1\" style=\"white-space: normal;\"><span class=\"s1\"><\/span><b>Understanding the CAP Theorem in Practice<\/b><\/p><p style=\"white-space: normal;\"><\/p><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The&nbsp;<strong>CAP theorem<\/strong>\u2014Consistency, Availability, and Partition Tolerance\u2014states that in a distributed database, you can guarantee only two out of the three properties at any one time.<\/p>\n\n\n\n<p><strong>TiDB takes a pragmatic approach<\/strong>: it prioritizes&nbsp;<strong>consistency and partition tolerance<\/strong>, using the Raft protocol to ensure that writes are only accepted by the current leader and replicated reliably. However, it does this without sacrificing high availability in real-world conditions, thanks to intelligent failover and Raft\u2019s fast leader elections.<\/p>\n\n\n\n<p>By understanding how TiDB balances these trade-offs, developers can confidently build systems that remain consistent under pressure\u2014without locking users out or risking data corruption.<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/tidb-architecture\">TiDB Architecture | TiDB Docs<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Data_Consistency_and_Conflict_Resolution\"><\/span><strong>Data Consistency and Conflict Resolution<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Consistency issues are among the most difficult&nbsp;<strong>distributed database challenges<\/strong>. With concurrent transactions across nodes, conflicts are inevitable.<\/p>\n\n\n\n<p>TiDB addresses this with&nbsp;<strong>Multi-Version Concurrency Control (MVCC)<\/strong>, enabling high-throughput reads without locking rows. For writes, TiDB relies on the Raft consensus model to resolve conflicts by sequencing changes in a leader-first pattern.<\/p>\n\n\n\n<p>To monitor changes across systems, TiDB provides\u00a0<strong><a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/ticdc-overview\">TiCDC<\/a><\/strong>, a change data capture tool that ensures your downstream systems stay in sync. These features make TiDB a strong fit for systems where\u00a0<strong>accuracy, consistency, and availability<\/strong> must coexist.<\/p>\n\n\n\n<p>Learn more about <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/tidb-storage\/\">TiDB Storage<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Schema_Management_and_Upgrades\"><\/span><strong>Schema Management and Upgrades<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>Schema changes in distributed systems<\/strong>&nbsp;are notoriously risky. Downtime, replication issues, and version mismatches can bring apps to a halt.<\/p>\n\n\n\n<p><strong>TiDB simplifies schema management<\/strong>&nbsp;through:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2705\u00a0<strong>Online schema changes<\/strong>\u00a0\u2013 Add indexes or columns without locking tables<\/li>\n\n\n\n<li>\u2705\u00a0<strong>Rolling upgrades<\/strong>\u00a0\u2013 Update nodes one by one without downtime<\/li>\n\n\n\n<li>\u2705\u00a0<strong>Schema coordination protocols<\/strong>\u00a0\u2013 Ensure consistency across all replicas<\/li>\n<\/ul>\n\n\n\n<p>Whether you\u2019re deploying new features or migrating versions, TiDB reduces the operational load and risk of failure. This is especially critical for teams shipping fast in production environments.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.pingcap.com\/ko\/article\/mastering-schema-management-in-tidb-for-scalable-databases\/\">Mastering Schema Management in TiDB for Scalable Databases<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_TiDB_Does_Differently\"><\/span><strong>What TiDB Does Differently<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>What sets&nbsp;<strong>\ud2f0DB<\/strong>&nbsp;apart from other distributed databases is its&nbsp;<strong>unified architecture<\/strong>&nbsp;for both transactional (OLTP) and analytical (OLAP) workloads\u2014often referred to as HTAP.<\/p>\n\n\n\n<p>Instead of forcing teams to choose between fast queries and reliable transactions, TiDB offers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u26a1\u00a0<strong>Row storage (TiKV)<\/strong>\u00a0for fast, transactional reads\/writes<\/li>\n\n\n\n<li>\ud83d\udcca\u00a0<strong>Columnar storage (<a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/tiflash-overview\">TiFlash<\/a>)<\/strong>\u00a0for analytical queries with no duplication effort<\/li>\n\n\n\n<li>\ud83d\udd04\u00a0<strong><a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/tidb-faq\">MySQL compatibility<\/a><\/strong>\u00a0for easy migrations<\/li>\n\n\n\n<li>\ud83d\ude80\u00a0<strong>Elastic horizontal scaling<\/strong>\u00a0for handling growing data loads<\/li>\n\n\n\n<li>\ud83d\udd01\u00a0<strong>Automated replication and recovery<\/strong>\u00a0to reduce downtime<\/li>\n<\/ul>\n\n\n\n<p>These innovations allow businesses to scale faster, maintain performance, and minimize the\u00a0<strong>distributed system tradeoffs<\/strong> that typically force hard decisions.<\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Distributed databases power the modern world\u2014but they\u2019re not without their challenges. From unpredictable network partitions to latency spikes and complex schema upgrades, these issues are more than just technical headaches\u2014they determine whether your system will scale or stall. In this guide, we\u2019ll unpack the\u00a0core challenges in distributed database design, explain how the\u00a0CAP theorem influences real-world [&hellip;]<\/p>\n","protected":false},"author":305,"featured_media":0,"template":"","class_list":["post-27713","article","type-article","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The Hard Parts of Distributed Databases (and How to Solve Them) | TiDB The Hard Parts of Distributed Databases (and How to Solve Them)<\/title>\n<meta name=\"description\" content=\"Distributed databases power the modern world\u2014but they\u2019re not without their challenges. From unpredictable network partitions to latency spikes and complex Distributed databases come with challenges\u2014network partitions, latency, consistency, and schema changes. Learn how TiDB tackles them using CAP theorem tradeoffs and modern architecture.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Hard Parts of Distributed Databases (and How to Solve Them) | TiDB The Hard Parts of Distributed Databases (and How to Solve Them)\" \/>\n<meta property=\"og:description\" content=\"Distributed databases power the modern world\u2014but they\u2019re not without their challenges. From unpredictable network partitions to latency spikes and complex Distributed databases come with challenges\u2014network partitions, latency, consistency, and schema changes. Learn how TiDB tackles them using CAP theorem tradeoffs and modern architecture.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/\" \/>\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=\"2025-06-02T20:13:44+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=\"Est. reading time\" \/>\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\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/\",\"url\":\"https:\/\/www.pingcap.com\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/\",\"name\":\"The Hard Parts of Distributed Databases (and How to Solve Them) | TiDB The Hard Parts of Distributed Databases (and How to Solve Them)\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"datePublished\":\"2025-06-02T20:13:43+00:00\",\"dateModified\":\"2025-06-02T20:13:44+00:00\",\"description\":\"Distributed databases power the modern world\u2014but they\u2019re not without their challenges. From unpredictable network partitions to latency spikes and complex Distributed databases come with challenges\u2014network partitions, latency, consistency, and schema changes. Learn how TiDB tackles them using CAP theorem tradeoffs and modern architecture.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/#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\":\"The Hard Parts of Distributed Databases (and How to Solve Them)\"}]},{\"@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":"The Hard Parts of Distributed Databases (and How to Solve Them) | TiDB The Hard Parts of Distributed Databases (and How to Solve Them)","description":"Distributed databases power the modern world\u2014but they\u2019re not without their challenges. From unpredictable network partitions to latency spikes and complex Distributed databases come with challenges\u2014network partitions, latency, consistency, and schema changes. Learn how TiDB tackles them using CAP theorem tradeoffs and modern architecture.","robots":{"index":"noindex","follow":"follow"},"og_locale":"ko_KR","og_type":"article","og_title":"The Hard Parts of Distributed Databases (and How to Solve Them) | TiDB The Hard Parts of Distributed Databases (and How to Solve Them)","og_description":"Distributed databases power the modern world\u2014but they\u2019re not without their challenges. From unpredictable network partitions to latency spikes and complex Distributed databases come with challenges\u2014network partitions, latency, consistency, and schema changes. Learn how TiDB tackles them using CAP theorem tradeoffs and modern architecture.","og_url":"https:\/\/www.pingcap.com\/ko\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_modified_time":"2025-06-02T20:13:44+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":{"Est. reading time":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/","url":"https:\/\/www.pingcap.com\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/","name":"The Hard Parts of Distributed Databases (and How to Solve Them) | TiDB The Hard Parts of Distributed Databases (and How to Solve Them)","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"datePublished":"2025-06-02T20:13:43+00:00","dateModified":"2025-06-02T20:13:44+00:00","description":"Distributed databases power the modern world\u2014but they\u2019re not without their challenges. From unpredictable network partitions to latency spikes and complex Distributed databases come with challenges\u2014network partitions, latency, consistency, and schema changes. Learn how TiDB tackles them using CAP theorem tradeoffs and modern architecture.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/article\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/#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":"The Hard Parts of Distributed Databases (and How to Solve Them)"}]},{"@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\/the-hard-parts-of-distributed-databases-and-how-to-solve-them\/\">            <h3>The Hard Parts of Distributed Databases (and How to Solve Them)<\/h3>            <p>Distributed databases power the modern world\u2014but they\u2019re not without their challenges. From unpredictable network partitions to latency spikes and complex schema upgrades, these issues are more than just technical headaches\u2014they determine whether your system will scale or stall. In this guide, we\u2019ll unpack the\u00a0core challenges in distributed database design, explain how the\u00a0CAP theorem influences real-world [&hellip;]<\/p>        <\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/article\/27713","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=27713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}