↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

CAP Theorem for Databases: Consistency, Availability & Partition Tolerance

The page explains that the CAP theorem applies to distributed data stores and says that, when a network failure happens, a system can provide either consistency or availability, but not both. It defines the three parts of CAP and says partition tolerance is required because distributed systems operate with network partitions.

Reading notes
#

  • Consistency means reads return the most recent write or an error.
  • Availability means reads return data, even if it is not the latest.
  • Partition tolerance means the system keeps operating despite network failures.
  • In a network failure, higher consistency reduces availability, and higher availability reduces consistency.
  • CAP consistency is about up-to-date information, which is different from ACID consistency.
  • For a user query, the system can return the current server value for availability or wait for the new write, or return an error, for consistency.
  • Brewer is quoted saying the goal should be to maximize the mix of consistency and availability that fits the application.
  • NoSQL databases are described as schema-free, without table relations, and associated with ease of use, scalable performance, strong resilience, and wide availability.
  • Consistent databases are presented as a fit for accurate information, such as bank account balances and text messages.
  • Available databases are presented as a fit for services where keeping the system up matters more than returning the latest information, such as e-commerce shopping carts.
  • Some databases, including Cosmos DB and Cassandra, let users choose between consistency and availability.