Page 46 - Building Big Data Applications
P. 46

40 Building Big Data Applications


             classic filesystem tree architectures; it is natively developed and deployed in Java and has
             bindings for Java and C.
                Because of its NoSQL origins, the architecture of Zookeeper is based on a hierarchical
             namespace structure (called zNodes). It uses the zNode architecture to allow distributed
             processes to coordinate and have interprocess communication mechanisms, in a low
             latency, high throughput, and ordered access environment. Sophisticated synchroniza-
             tion is implemented at the client by using a feature called ordering based on vector
             clocks and timestamps. ZooKeeper is primarily designed to store coordination data:
             status information, configuration, location information, etc and not large data volumes.
             By default, ZooKeeper has a built-in check for a maximum size of 1 MB.


             Zookeeper features

             Data ModeldA Zookeeper model is simple to understand
               A parent namespace called zNode
                  Contains children and further levels of zNodes
                  Can have data associated with any level
                  Has Access Control Lists
                  A session based node called Ephemeral node can be created and destroyed by a
                   session
                  zNodes can be sequential, this ordering helps manage complex interconnected
                   tasks
                  zNodes can have watches to provide for callbacks. This helps when data is
                   distributed and tasks are distributed in a large cluster
               APIdZookeeper has a simple set of API commands to work with
                  string create(path, data, acl, flags)
                  delete(path, expected_version)
                  statset_data(path, data, expected_version)
                  (data, stat) get_data(path, watch)
                  stat exists(path, watch)
                  stringget_children(path, watch)
               Zookeeper ConsistencydZookeeper offers a data consistency model to provide
                guarantees with its services
                  Sequential ConsistencydUpdates from a client are applied in the order sent
                  AtomicitydUpdates either succeed or fail
                  Single System ImagedUnique view, regardless of the server
                  DurabilitydUpdates once succeeded will not be undone
                  TimelinessdLag is bounded, read operations can lag leaders
               Used for
                  Configuration service dGet latest configuration and get notified changes occur
                  Lock servicedProvide mutual exclusion
   41   42   43   44   45   46   47   48   49   50   51