O teorema CAP afirma que um sistema distribuído pode garantir no máximo dois de três atributos — Consistência, Disponibilidade e Tolerância a partições — ao mesmo tempo. Como as partições de rede são inevitáveis, a escolha real é entre consistência e disponibilidade durante uma partição.
As três propriedades
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.
