{"id":23726,"date":"2024-11-30T21:55:00","date_gmt":"2024-12-01T05:55:00","guid":{"rendered":"https:\/\/www.pingcap.com\/?post_type=article&#038;p=23726"},"modified":"2026-09-10T11:23:50","modified_gmt":"2026-09-10T18:23:50","slug":"ensuring-data-consistency-in-distributed-systems","status":"publish","type":"article","link":"https:\/\/www.pingcap.com\/ko\/article\/ensuring-data-consistency-in-distributed-systems\/","title":{"rendered":"Data Consistency in Distributed Systems: How TiDB Achieves It"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Replicate data across machines and you inherit a question a single-server database never had to answer: when two nodes disagree about a value, which one is right? Every distributed system answers with a consistency model, and the answer determines whether your application can trust what it reads. This page defines data consistency, compares the three models you will choose between, and shows the mechanisms <a href=\"https:\/\/www.pingcap.com\/ko\/tidb\/\">\ud2f0DB<\/a> uses to keep strong consistency without giving up availability.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_Data_Consistency_in_Distributed_Systems\"><\/span><strong>What Is Data Consistency in Distributed Systems?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Data consistency in a distributed system is the guarantee that every node presents the same view of the data, so a read returns a value the system agrees on rather than whichever copy the request reached. The guarantee is set by the system&#8217;s consistency model, which defines the recency and ordering an application can rely on. Strong consistency means every read returns the most recent committed write; weaker models allow reads to lag or to observe operations in different orders.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Three models cover most decisions. Strong consistency guarantees that a read returns the latest committed write, and that all clients observe operations in one order. Eventual consistency guarantees only that replicas converge once writes stop, so a read may return a stale value meanwhile. Causal consistency sits between them: causally related operations are observed in order, while unrelated concurrent ones may differ per replica.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Consistency_Is_Hard_to_Guarantee_at_Scale\"><\/span><strong>Why Consistency Is Hard to Guarantee at Scale<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Three physical realities make this difficult. Network partitions cut nodes off with no way to tell a slow peer from a dead one. Replication latency means a write acknowledged on one node has not reached the others. Node failures remove replicas mid-operation, sometimes after a write is accepted but before it is durable elsewhere.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The CAP theorem states the resulting constraint: during a network partition, a system can preserve consistency or availability, not both. Consider a transfer that debits one account and credits another. If the system stays available during a partition and accepts writes on both sides, both can debit the same balance, and reconciliation happens after the money is gone. If it preserves consistency, the minority side refuses writes and the transfer fails cleanly, which is recoverable. For financial data, the second failure is the one you want.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Consistency_Models_Compared\"><\/span><strong>Consistency Models Compared<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Model<\/strong><\/th><th><strong>Guarantee<\/strong><\/th><th><strong>Latency cost<\/strong><\/th><th><strong>Example use case<\/strong><\/th><\/tr><\/thead><tbody><tr><td>Strong (linearizable)<\/td><td>Read returns the latest committed write; one global order<\/td><td>Highest: coordination on every write, floor set by replica distance<\/td><td>Payment ledgers, inventory, order books<\/td><\/tr><tr><td>Causal<\/td><td>Causally related operations ordered; concurrent ones may vary per replica<\/td><td>Moderate: only related operations need ordering<\/td><td>Messaging, comment threads, collaborative editing<\/td><\/tr><tr><td>Eventual<\/td><td>Replicas converge once writes stop<\/td><td>Lowest: no coordination before acknowledging<\/td><td>View counters, DNS, cache invalidation<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Stronger models put coordination cost in the database; weaker ones put reconciliation code in your application. For the client-centric guarantees a user actually notices, such as read-your-writes, see <a href=\"https:\/\/www.pingcap.com\/ko\/article\/understanding-consistency-models-in-distributed-systems\/\">consistency models in distributed systems<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_TiDB_Solves_the_Consistency_vs_Availability_Trade-off\"><\/span><strong>How TiDB Solves the Consistency vs. Availability Trade-off<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">TiDB chooses consistency, and the mechanism is specific enough to be worth naming precisely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Data is split into Regions, contiguous ranges of key-value pairs. Each Region&#8217;s replicas form their own independent Raft group with their own leader, so a cluster holding thousands of Regions runs thousands of Raft groups concurrently. That is what Multi-Raft describes. This matters for availability: a write commits once a majority of that Region&#8217;s replicas have persisted it, so a node failure cannot lose a committed write, and leadership spreads across the cluster rather than concentrating in one coordinator. If a leader fails, the remaining replicas elect a new one automatically without losing a committed write. See <a href=\"https:\/\/docs.pingcap.com\/tidb\/stable\/tidb-architecture\/\">TiDB&#8217;s architecture<\/a> and the wider <a href=\"https:\/\/www.pingcap.com\/ko\/article\/exploring-tidbs-distributed-sql-database-architecture\/\">distributed SQL architecture<\/a> overview.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Raft covers replication within a Region. Transactions spanning Regions need more, and TiDB uses a Percolator-style two-phase commit over multi-version concurrency control. One key acts as the primary and the rest as secondaries; committing the primary key is the atomic decision point, so a transaction touching many Regions commits everywhere or nowhere. MVCC lets reads proceed against a stable snapshot without blocking on in-flight writes, giving Snapshot Isolation by default with no configuration required.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Data_Consistency_for_AI_Agent_Workloads\"><\/span><strong>Data Consistency for AI Agent Workloads<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Agent workloads make consistency a correctness problem rather than a user-experience one. An agent reads state, decides, writes, then reads again on the next step. If a read returns a stale value, the agent may act on state it has already changed, and unlike a human user it will not notice and retry. Eventual consistency turns every read into a decision on possibly outdated information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.pingcap.com\/ko\/case-study\/kimi-2-6-agent-hosting-platform-tidb-cloud\/\">Kimi&#8217;s agent hosting platform<\/a> shows what predictable reads buy at scale. Kimi, the AI product from Moonshot AI, runs a K2.6 agent that turns a plain-language request into a deployed and hosted web application, frontend and backend included. It runs tens of millions of concurrent tenant sites on TiDB Cloud, each agent task receiving a fully prepared database in under one second. The detail that matters here: the agent generates application code with no retry or polling logic for database availability. Every extra boundary an agent reasons across adds a class of failure it must handle, and predictable reads remove one of them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Test the guarantees against your own workload. <a href=\"https:\/\/tidbcloud.com\/free-trial\">Start with TiDB Cloud Starter, free<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span><strong>Frequently Asked Questions<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1789064562162\"><strong class=\"schema-faq-question\"><strong>What is the difference between strong and eventual consistency?<\/strong><\/strong> <p class=\"schema-faq-answer\">Strong consistency guarantees that a read returns the most recently committed write and that all clients observe operations in the same order, as though only one copy existed. Eventual consistency guarantees only that replicas converge once writes stop, so a read may return a stale value and two simultaneous reads against different replicas may disagree. Strong consistency puts coordination cost in the database; eventual consistency pushes conflict resolution into the application.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1789064571265\"><strong class=\"schema-faq-question\"><strong>Does TiDB guarantee strong consistency?<\/strong><\/strong> <p class=\"schema-faq-answer\">Yes, by default and without configuration. Each Region&#8217;s replicas form a Raft group that commits a write only after a majority have persisted it, and reads are served from the Region leader. Transactions spanning Regions use a Percolator-style two-phase commit over MVCC, so they commit everywhere or nowhere. The isolation level is Snapshot Isolation, exposed as REPEATABLE-READ for MySQL compatibility.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1789064582115\"><strong class=\"schema-faq-question\"><strong>How does the CAP theorem apply to distributed SQL databases?<\/strong><\/strong> <p class=\"schema-faq-answer\">The CAP theorem says that during a network partition a system must choose between consistency and availability. Distributed SQL databases including TiDB choose consistency: the minority side of a partition stops accepting writes rather than accepting writes it cannot reconcile. The majority side keeps serving, so the effect is not total unavailability but reduced availability confined to the partitioned minority. CAP constrains behavior during failures, not normal operation.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1789064590744\"><strong class=\"schema-faq-question\"><strong>Can a distributed database be both consistent and highly available?<\/strong><\/strong> <p class=\"schema-faq-answer\">In everyday operation, yes. High availability comes from replication and automatic failover, and TiDB delivers both while remaining strongly consistent, since a majority of replicas can commit and serve reads even when nodes fail. What CAP rules out is preserving both during a network partition. A system can survive many node failures with no consistency loss and still refuse writes on the minority side of a partition, which is why availability targets should be stated as a tolerated number of failures rather than an absolute.<\/p> <\/div> <\/div>","protected":false},"excerpt":{"rendered":"<p>Explore data consistency types and TiDB&#8217;s approach to reliable distributed systems.<\/p>","protected":false},"author":275,"featured_media":0,"template":"","class_list":["post-23726","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>Data Consistency in Distributed Systems Explained | TiDB<\/title>\n<meta name=\"description\" content=\"See how TiDB uses Raft consensus and Multi-Raft groups to guarantee strong data consistency across nodes, with real customer examples.\" \/>\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\/ensuring-data-consistency-in-distributed-systems\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Consistency in Distributed Systems Explained | TiDB\" \/>\n<meta property=\"og:description\" content=\"See how TiDB uses Raft consensus and Multi-Raft groups to guarantee strong data consistency across nodes, with real customer examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/article\/ensuring-data-consistency-in-distributed-systems\/\" \/>\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-10T18:23:50+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=\"6\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/\",\"url\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/\",\"name\":\"Data Consistency in Distributed Systems Explained | TiDB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#website\"},\"datePublished\":\"2024-12-01T05:55:00+00:00\",\"dateModified\":\"2026-09-10T18:23:50+00:00\",\"description\":\"See how TiDB uses Raft consensus and Multi-Raft groups to guarantee strong data consistency across nodes, with real customer examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064562162\"},{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064571265\"},{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064582115\"},{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064590744\"}],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#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\":\"Data Consistency in Distributed Systems: How TiDB Achieves It\"}]},{\"@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\":\"Question\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064562162\",\"position\":1,\"url\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064562162\",\"name\":\"What is the difference between strong and eventual consistency?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Strong consistency guarantees that a read returns the most recently committed write and that all clients observe operations in the same order, as though only one copy existed. Eventual consistency guarantees only that replicas converge once writes stop, so a read may return a stale value and two simultaneous reads against different replicas may disagree. Strong consistency puts coordination cost in the database; eventual consistency pushes conflict resolution into the application.\",\"inLanguage\":\"ko-KR\"},\"inLanguage\":\"ko-KR\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064571265\",\"position\":2,\"url\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064571265\",\"name\":\"Does TiDB guarantee strong consistency?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes, by default and without configuration. Each Region's replicas form a Raft group that commits a write only after a majority have persisted it, and reads are served from the Region leader. Transactions spanning Regions use a Percolator-style two-phase commit over MVCC, so they commit everywhere or nowhere. The isolation level is Snapshot Isolation, exposed as REPEATABLE-READ for MySQL compatibility.\",\"inLanguage\":\"ko-KR\"},\"inLanguage\":\"ko-KR\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064582115\",\"position\":3,\"url\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064582115\",\"name\":\"How does the CAP theorem apply to distributed SQL databases?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The CAP theorem says that during a network partition a system must choose between consistency and availability. Distributed SQL databases including TiDB choose consistency: the minority side of a partition stops accepting writes rather than accepting writes it cannot reconcile. The majority side keeps serving, so the effect is not total unavailability but reduced availability confined to the partitioned minority. CAP constrains behavior during failures, not normal operation.\",\"inLanguage\":\"ko-KR\"},\"inLanguage\":\"ko-KR\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064590744\",\"position\":4,\"url\":\"https:\\\/\\\/www.pingcap.com\\\/article\\\/ensuring-data-consistency-in-distributed-systems\\\/#faq-question-1789064590744\",\"name\":\"Can a distributed database be both consistent and highly available?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"In everyday operation, yes. High availability comes from replication and automatic failover, and TiDB delivers both while remaining strongly consistent, since a majority of replicas can commit and serve reads even when nodes fail. What CAP rules out is preserving both during a network partition. A system can survive many node failures with no consistency loss and still refuse writes on the minority side of a partition, which is why availability targets should be stated as a tolerated number of failures rather than an absolute.\",\"inLanguage\":\"ko-KR\"},\"inLanguage\":\"ko-KR\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Consistency in Distributed Systems Explained | TiDB","description":"See how TiDB uses Raft consensus and Multi-Raft groups to guarantee strong data consistency across nodes, with real customer examples.","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\/ensuring-data-consistency-in-distributed-systems\/","og_locale":"ko_KR","og_type":"article","og_title":"Data Consistency in Distributed Systems Explained | TiDB","og_description":"See how TiDB uses Raft consensus and Multi-Raft groups to guarantee strong data consistency across nodes, with real customer examples.","og_url":"https:\/\/www.pingcap.com\/ko\/article\/ensuring-data-consistency-in-distributed-systems\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_modified_time":"2026-09-10T18:23:50+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":"6\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/","url":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/","name":"Data Consistency in Distributed Systems Explained | TiDB","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"datePublished":"2024-12-01T05:55:00+00:00","dateModified":"2026-09-10T18:23:50+00:00","description":"See how TiDB uses Raft consensus and Multi-Raft groups to guarantee strong data consistency across nodes, with real customer examples.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064562162"},{"@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064571265"},{"@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064582115"},{"@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064590744"}],"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#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":"Data Consistency in Distributed Systems: How TiDB Achieves It"}]},{"@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":"Question","@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064562162","position":1,"url":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064562162","name":"What is the difference between strong and eventual consistency?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Strong consistency guarantees that a read returns the most recently committed write and that all clients observe operations in the same order, as though only one copy existed. Eventual consistency guarantees only that replicas converge once writes stop, so a read may return a stale value and two simultaneous reads against different replicas may disagree. Strong consistency puts coordination cost in the database; eventual consistency pushes conflict resolution into the application.","inLanguage":"ko-KR"},"inLanguage":"ko-KR"},{"@type":"Question","@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064571265","position":2,"url":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064571265","name":"Does TiDB guarantee strong consistency?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes, by default and without configuration. Each Region's replicas form a Raft group that commits a write only after a majority have persisted it, and reads are served from the Region leader. Transactions spanning Regions use a Percolator-style two-phase commit over MVCC, so they commit everywhere or nowhere. The isolation level is Snapshot Isolation, exposed as REPEATABLE-READ for MySQL compatibility.","inLanguage":"ko-KR"},"inLanguage":"ko-KR"},{"@type":"Question","@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064582115","position":3,"url":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064582115","name":"How does the CAP theorem apply to distributed SQL databases?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The CAP theorem says that during a network partition a system must choose between consistency and availability. Distributed SQL databases including TiDB choose consistency: the minority side of a partition stops accepting writes rather than accepting writes it cannot reconcile. The majority side keeps serving, so the effect is not total unavailability but reduced availability confined to the partitioned minority. CAP constrains behavior during failures, not normal operation.","inLanguage":"ko-KR"},"inLanguage":"ko-KR"},{"@type":"Question","@id":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064590744","position":4,"url":"https:\/\/www.pingcap.com\/article\/ensuring-data-consistency-in-distributed-systems\/#faq-question-1789064590744","name":"Can a distributed database be both consistent and highly available?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"In everyday operation, yes. High availability comes from replication and automatic failover, and TiDB delivers both while remaining strongly consistent, since a majority of replicas can commit and serve reads even when nodes fail. What CAP rules out is preserving both during a network partition. A system can survive many node failures with no consistency loss and still refuse writes on the minority side of a partition, which is why availability targets should be stated as a tolerated number of failures rather than an absolute.","inLanguage":"ko-KR"},"inLanguage":"ko-KR"}]}},"card_markup":"        <a class=\"card-article\" href=\"https:\/\/www.pingcap.com\/ko\/article\/ensuring-data-consistency-in-distributed-systems\/\">            <h3>Data Consistency in Distributed Systems: How TiDB Achieves It<\/h3>            <p>Explore data consistency types and TiDB's approach to reliable distributed systems.<\/p>        <\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/article\/23726","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\/275"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=23726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}