I recently started my journey into system design and data-intensive applications. This experience has completely changed how I look at software — especially around the hard tradeoffs of consistency, availability, and what happens when things go wrong at scale.
Let me start with a scenario that surprised me when I first encountered it:
Imagine you just inserted a record in your app. A millisecond later, a read on a different server returns the old data. How? Welcome to distributed systems.
What is CAP Theorem?
CAP stands for Consistency , Availability , and Partition Tolerance . The theorem states that a distributed system can only guarantee 2 out of these 3 properties at any given time.
Consistency — Every read returns the most recent write, or an error. All nodes in the system see the same data at the same time.
Availability — Every request gets a response (not an error), even if some nodes are down.…