🧠
MY SECOND BRAIN
meBlogLinkedInGitHub
  • Second brain
  • AI - Artificial Intelligent
    • AI-labeling
    • AI-training
  • Books
  • Code
    • Linux
    • Gradle
  • Company
    • Interview
  • Computer science
    • Data Structures
    • Algorithms
    • Concurrency
  • Container
    • Docker
      • Docker | Private Docker Registry
    • Kubernetes
  • Distributed systems
    • Akka
    • Analytics
    • Delivery guarantee
    • Kafka
    • Rebalancing
    • RPC
      • gRPC
  • Food
    • Recipes
      • Tiramisu
  • Git
  • GH CLI
    • GH CLI | Pull Request
  • SSH
    • SSH bastion | SSH Jump host
    • SCP
  • Learning
  • Management
  • Reactive systems
  • System Design
    • CAP Theorem
    • Domain Driven Design
    • System Design Interview
    • Load Balancing
    • CDN
  • OCR
  • Productivity
    • Alfred
  • Health
    • Teeth
  • Devops
  • Data stores
    • Elasticsearch
    • Mongo
  • Germany
    • Berlin
      • Where is to buy Christmas trees in Berlin
    • Internet in Germany
      • Install custom router for telekom
  • Transport
    • Bikes
  • Travel
    • Russia
      • Moscow
        • Moscow Attractions
    • United Kingdom
  • Writing
    • Markdown
      • Markdown Tables
  • Programming languages
    • Java
      • Java | OCR
      • Java | Spring
      • JAVA | How to install multiple Java versions on macOS
    • Go
    • Kotlin
    • Python
  • Optimization
    • Email
      • Zero inbox
  • Finance
    • Investment
      • Online brokers
  • People
  • Security
    • SaaS Security
  • Unix
    • Shell
      • ZSH
  • Work
    • Feedback
Powered by GitBook
On this page
  • Consistency
  • Links
  1. System Design

CAP Theorem

PreviousSystem DesignNextDomain Driven Design

Last updated 2 years ago

CAP is acronym for Consistency, Availability, and Partition Tolerance. It is a theorem that states that it is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees:

  • CA (Consistency and Availability) - All nodes see the same data at the same time. This guarantee is not applied for distributed systems because they have to be Partition Tolerance

  • AP (Availability and Partition Tolerance) - Every request receives a (non-error) response, without the guarantee that the data is the most recent.

  • CP (Consistency and Partition Tolerance) - Every request receives a (non-error) response, with the guarantee that the data is the most recent.

Consistency

Strong Consistency - during the write operation, all replicas in the system should be updated before the write operation is acknowledged as performed. In other words, any read operation always returns the most recent write. Achieving strong consistency requires a high level of coordination and synchronization between nodes, which can affect availability.

Eventual Consistency – during the write operation, the replicas in the system are updated asynchronously. In that case, replicas in the system could return stale data for a period of time until the change is propagated to all replicas.

Links

  • – I liked the examples which were used to explain the CAP theorem.

Video by IBM Technology: What is CAP Theorem?
Video by ByteByteGo: CAP Theorem Simplified | System Design Fundamentals
Video by Studying with Alex: Friendly Intro To the CAP Theorem (Consistency vs Availability vs Partition Tolerance)
Article by Vivek Kumar Singh: Eventual Consistency vs Strong Consistency
Article by Peter Bailis: Linearizability versus Serializability