问题
I need to design distributed application using zookeeper. This is the first time I am using Zookeeper so I am little confused with its usage. I have read that Zab protocol ensures serializability when it comes to multiple updates but I am unable to understand, if that is the case than it will automatically allow lock free implementation. So why locks are needed in first place? It will be great if some one can help here.
Thanks
回答1:
Zab protocol is a critical PART of zookeeper.It ensures atomic broadcast of messages to the replicas . Zab protocol ensures serializability but the concept of serializability only ensures atomic data deliver to a single application . Apache used this protocol to implement atomic broadcast in zookeeper.
Zookeeper is used for distributed services co-ordination .In a system where n processes are coordinating , to maintain a particular sequence of execution we need distributed locks.
来源:https://stackoverflow.com/questions/24066482/distributed-application-using-zookeeper