blog.suje.sh

System Design

Understanding CAP and PACELC — Why Distributed Systems Can't Have It All

I have been working as a backend developer for a while now, mostly building Java microservices using Spring Boot. In day-to-day work, I often come across terms like consistency, availability, and replication while designing APIs or integrating with databases. Even though I’ve used distributed systems like Kafka, Redis, and MongoDB in projects, I realized I never really understood why they behave the way they do under network failures. So, I decided to spend some time reading about these two important concepts — CAP and PACELC — and document my understanding here.