Il teorema CAP afferma che un sistema distribuito può garantire al massimo due delle tre proprietà — Consistenza, Disponibilità e Tolleranza ai partizionamenti — contemporaneamente. Poiché i partizionamenti di rete sono inevitabili, la scelta reale è tra consistenza e disponibilità durante un partizionamento.
Le tre proprietà
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.
