2
$\begingroup$

Zookeeper is based on the Zab (which is slightly different to Paxos) system.

We can do Atomic locks on top of a Zookeeper cluster.

Zookeeper provides eventual consistency.

Zookeeper provides durability.

(I'm aware that Zookeeper sacrifices Availability for Consistency and Partition Tolerance - making it CP - but I'm not asking that question here. )

My question is: Can we say that Zookeeper updates are ACD (ACID without the I)?

$\endgroup$
2
$\begingroup$

Atomicity is not about being able to implement "atomic locks" or not. Consistency as used in the CAP theorem (i.e. the C in CAP) is not the same thing as Consistency in ACID, and Consistency in CAP is way stronger than eventual consistency. ZooKeeper is an ACID system and a CP system, albeit the ACID "C" is not doing much work here.

Atomicity means a "transaction" either completes entirely or not at all. It's mostly orthogonal to concurrency. If you had a system that was Atomic but not Isolated, transactions could see the intermediate results of other in-progress transactions regardless of whether those other transactions got rolled back or not. Meanwhile, a non-Atomic but Isolated system would not see any intermediate results of in-progress transactions, but failed transactions need not rollback their work, so the detritus of failed transactions would be visible to all. Atomicity alone would not allow you to implement atomic locks; Isolation is really the more important property for that though technically Atomicity is also required.

Consistency in ACID means maintaining integrity constraints. ZooKeeper provides few such constraints, so this is accomplished more or less trivially. Consistency in CAP refers to linearizability which is different than but related to Isolation. Isolation refers to serializability. Traditionally, (one-copy) serializability was effectively strict one-copy serializability which is the combination of serializability and linearizability, but serializability and linearizability are actually distinct (though similar looking) notions, neither implying the other. ZooKeeper provides strict one-copy serializability (if you sync before every read), and thus it is both Isolated and Consistent in the CAP sense.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.