CAP theorem कहता है कि एक distributed system एक साथ अधिकतम तीन में से दो properties — Consistency, Availability, और Partition tolerance — की गारंटी दे सकता है। चूँकि network partitions अपरिहार्य हैं, वास्तविक विकल्प एक partition के दौरान consistency और availability के बीच है।
तीन properties
CONSISTENCY (C) → every read sees the latest write (all nodes agree on the data)
AVAILABILITY (A) → every request gets a response (the system stays responsive)
PARTITION TOLERANCE (P) → the system keeps working despite network partitions
(communication breaks between nodes)
→ CAP: you can only fully guarantee TWO of these three simultaneously.
