Search code examples
cassandrapartitioninghigh-availabilityconsistencycap-theorem

Which part of the CAP theorem does Cassandra sacrifice and why?


There is a great talk here about simulating partition issues in Cassandra with Kingsby's Jesper library.

My question is - with Cassandra are you mainly concerned with the Partitioning part of the CAP theorem, or is Consistency a factor you need to manage as well?


Solution

  • Cassandra is typically classified as an AP system, meaning that availability and partition tolerance are generally considered to be more important than consistency. However, real world systems rarely fall neatly into these categories, so it's more helpful to view CAP as a continuum. Most systems will make some effort to be consistent, available, and partition tolerant, and many (including Cassandra) can be tuned depending on what's most important. Turning knobs like replication factor and consistency level can have a dramatic impact on C, A, and P.

    Even defining what the terms mean can be challenging, as various use cases have different requirements for each. So rather than classify a system as CP, AP, or whatever, it's more helpful to think in terms of the options it provides for tuning these properties as appropriate for the use case.

    Here's an interesting discussion on how things have changed in the years since the CAP theorem was first introduced.