Search code examples
distributedpartitioncap-theorem

Is my distributed database C+A or A+P?


Let a distributed database have a recover mechanism such as, in case it is splitted by a network partition which allows two sides to keep working, both sides continue to commit transactions and, when the partition is ending, they agree to go back to the last common state.

Should we say that this system :

  • is A+P, as it has a built-in (not very clever) mechanism to deal with partitions, and the consistency is sort of broken by the fact we can deny a commit which has been done ?
  • is C+A, as it does not really deals with partitions, and the state is always consistent (never a mixed weird thing recorded) ?
  • another more complicated option ?

Solution

  • "when the partition is ending, they agree to go back to the last common state."

    Do you mean to say all the writes since time t1 (when partition split occurs) to time t2 (when partition split ends) are lost?

    That makes your database neither consistent nor durable.

    However, you'd be providing availability and partition tolerance.