Search

CAP

What Does CAP Mean?

CAP describes a limit in distributed systems: during a network partition, a system cannot guarantee both linearizable consistency and availability for every request.
โ€ข
Consistency: operations behave as if there were one up-to-date copy, respecting the order of completed operations.
โ€ข
Availability: every request to a non-failing node eventually receives a result, rather than being left waiting indefinitely.
โ€ข
Partition: nodes cannot reliably exchange messages with one another.

Example: Two Copies of a Balance

Suppose two nodes lose contact and one receives a balance update. The other cannot know whether its copy is current. Refusing or delaying some operations can protect consistency. Continuing to accept operations on both sides can preserve availability, but the system needs rules for stale reads or conflicting updates.

Common Misunderstandings

โ€œPick any twoโ€ hides the important condition: the conflict arises when a partition occurs. Partition tolerance is not simply an optional feature that makes unreliable networks disappear.
CAP consistency is not the same as the C in ACID, which concerns application invariants. SQL and NoSQL are also not fixed CAP categories. Evaluate a productโ€™s deployment, operation, and consistency settings rather than assigning guarantees from its label alone.

Reference

CAP ์ด๋ก  ์†Œ๊ฐœ - ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ดˆ๋ณด์ž์šฉ
๋ฐ‘์— ์„ธ์ค„์š”์•ฝ ์žˆ์Œ ์‚ดํŽด๋ณด๊ธฐ CAP ์ด๋ก ์ด๋ž€? MongoDB์˜ CP ์‹œ์Šคํ…œ๊ณผ Cassandra์˜ AP ์‹œ์Šคํ…œ CAP๋ž€? ๋ถ„์‚ฐ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋Š” ๋ฐฉ๋Œ€ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ค๋ฃจ๊ธฐ์— ์œ ์šฉํ•œ ์‹œ์Šคํ…œ์ด๋‹ค. ๋ถ„์‚ฐ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋Š” ์ˆ˜ํ‰ ํ™•์žฅํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ํŠธ๋ž˜ํ”ฝ์ด ์ฆ๊ฐ€ํ•˜๋”๋ผ๋„ ๋‚ฎ์€ ์ง€์—ฐ ์‹œ๊ฐ„์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ๊ณ , ์ผ๋ถ€ ๋…ธ๋“œ ์žฅ์• ์— ์ ์ ˆํžˆ ๋Œ€์‘ํ•  ์ˆ˜ ์žˆ๋‹ค. NoSQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋Š” ๋Œ€ํ‘œ์ ์ธ ๋ถ„์‚ฐ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์ด๋ฉฐ, ์œ ์—ฐํ•˜๊ฒŒ ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ๋‹ค๋Š” ์žฅ์ ์ด ์žˆ๋‹ค. NoSQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋Š” ์„œ๋กœ ๋‹ค๋ฅธ ํŠน์ง•์„ ๊ฐ€์ง„ ์—ฌ๋Ÿฌ ์ œํ’ˆ์ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ๋งž๋Š” ํŠน์„ฑ์— ๋งž๋Š” ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์„ ํƒํ•ด์•ผ ํ•œ๋‹ค. ์ด๋ฅผ ์œ„ํ•ด์„œ๋Š” ๊ฐ ์ œํ’ˆ์˜ ํŠน์ง•๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ด๋ก  ๋˜ํ•œ ์ดํ•ดํ•ด์•ผ ํ•œ๋‹ค. CAP๋Š” ๋ถ„์‚ฐ ๋ฐ์ด๋ฒ ์ด์Šค ์†์„ฑ์— ๊ด€ํ•œ ์ด๋ก ์œผ๋กœ์จ, ๋ถ„์‚ฐ ๋ฐ..