_php example of using detailed zookeeper based on the

Source: Internet
Author: User
Tags data structures zookeeper

Please check the Zookeeper website for more information

Zookper: A collaborative service for distributed applications

Zookper is a distributed, Open-source, collaborative service that applies to distributed applications. It provides simple operations that allow distributed applications to implement services such as synchronization, configuration maintenance, and clustering or naming, based on these interfaces. Zookper is easy to access programmatically, and it uses a data model similar to the file tree structure. You can use Java or C for programmatic access.

It is well known that distributed system Collaboration service is difficult to have a satisfying product. These collaborative services products are easily caught in traps such as competitive selection conditions or deadlocks. The goal of Zookper is to no longer need to implement collaborative services as a result of collaboration conflicts in distributed services.

The design goal zookeeper is simple

Zookeeper enables distributed processes to work together through a hierarchical namespace that resembles file systems. These namespaces are made up of a series of data registers, which we also call the data registers as znodes. These znodes are sort of like files and folders in a file system. Unlike file systems, file system files are stored on the storage area, and zookeeper data is stored on memory. At the same time, this means that zookeeper has a high throughput and low latency.

Zookeeper achieves high performance, high reliability, and orderly access. High performance ensures that zookeeper can be applied to large distributed systems. High reliability guarantees that it will not cause any problems due to a single node failure. Orderly access can ensure that the client can achieve more complex synchronization operations.

zookeeper is reusable.

Zookeeper Service

The servers that make up the zookeeper must be able to communicate with each other. They save the server state in memory, also save the log of the operation, and persist the snapshot. As long as most servers are available, zookeeper is available.

The client connects to a zookeeper server and maintains the TCP connection. and sends the request, obtains the reply, obtains the event, and sends the connection signal. If this TCP connection is broken, the client can connect to another server.

zookeeper is orderly.

Zookeeper uses numbers to mark each update. This ensures the orderly zookeeper interaction. Subsequent operations can implement higher and more abstract services such as synchronous operations in this order.

zookeeper is efficient.

The efficiency of zookeeper is more manifested in the system with the main reading. Zookeeper can perform well on distributed systems that have a 10:1 read/write ratio of thousands of servers.

data structures and hierarchical namespaces

The Zookeeper namespace has a similar structure to the file system. The path representation of a name and file, each node of the zookeeper is uniquely identified by the path

Zookeeper ' s hierarchical Namespace

Implement

The following figure shows the advanced Component Services for the Zookeeper service. In addition to the request processor, each server in the Zookeeper server group replicates each of their own components.

Zookeeper components

The replicated database is a structure stored in memory that contains the entire data tree. All update operations are logged to the hard drive. And the write operation is serialized to the hard disk when it functions in the database.

Each zookeeper server is connected to many clients. The client connects to a server to submit the request.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.