CAP Theorem

Src: blog.devtrovert.com

The CAP Theorem is a fundamental principle in distributed computing. It says that a distributed system can only guarantee two out of the following three properties at the same time:

  1. Consistency: Every read gets the most recent write or an error. Imagine a library catalog. If you update a book's location, everyone searching for it should see the new location.

  2. Availability: Every request gets a response without guaranteeing that it contains the most recent write, like a convenience store that's always open but might sometimes run out of your favorite snack.

  3. Partition Tolerance: The system continues to operate despite some messages being dropped (due to network failures). It's like having a team in different rooms; even if the intercom breaks, they keep working with the info they have.

Src: Factor-bytes.com

Real-world examples

  • Social Media

  • Financial Systems

  • IoT

  • eCommerce

  • CDN (Content Delivery Networks)

Last updated