Home > Backend Development > PHP Tutorial > Detailed explanation of usage based on Zookeeper_PHP tutorial

Detailed explanation of usage based on Zookeeper_PHP tutorial

WBOY
Release: 2016-07-21 15:10:26
Original
1026 people have browsed it

For more information, please check the zookeeper official website

Zookper: a collaboration service for distributed applications

Zookper is a distributed, open source, collaboration service for distributed applications. It provides some simple operations so that distributed applications can implement services such as synchronization, configuration maintenance, and clustering or naming based on these interfaces. Zookper is easy to program and uses a data model similar to a file tree structure. Programming access can be done using Java or C.

As we all know, it is difficult to produce satisfactory products for distributed system collaboration services. These collaborative service products can easily fall into traps such as competing selection conditions or deadlocks. The purpose of Zookper is to eliminate the need for distributed services to implement additional collaboration services due to collaboration conflicts.

Design Goal Zookeeper is simple

Zookeeper allows distributed processes to work with each other through a hierarchical namespace similar to a file system. These namespaces consist of a series of data registers, which we also call znodes. These znodes are a bit like files and folders in a file system. Unlike the file system, the files of the file system are stored in the storage area, while the zookeeper data is stored in the memory. At the same time, this means that ZooKeeper has high throughput and low latency.

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

Zookeeper is reusable

ZooKeeper Service

image

The servers that make up Zookeeper must be able to communicate with each other. They store server state in memory, log operations, and persist snapshots. As long as most servers are available, Zookeeper is available.

The client connects to a Zookeeper server and maintains a TCP connection. And send requests, get replies, get events, and send connection signals. If the TCP connection is disconnected, the client can connect to another server.

Zookeeper is orderly

Zookeeper uses numbers to mark each update. This ensures orderly Zookeeper interactions. Subsequent operations can implement higher and more abstract services such as synchronization operations based on this sequence.

Zookeeper is efficient

The efficiency of Zookeeper is even more reflected in read-oriented systems. Zookeeper can perform well on a distributed system composed of thousands of servers with a read-write ratio of approximately 10:1.

Data structures and hierarchical namespaces

The structure of Zookeeper's namespace is very similar to that of a file system. A path is represented by the same / as the file name. Each node in zookeeper is uniquely identified by the path

ZooKeeper's Hierarchical Namespace

image

Achievement

The following figure shows the high-level component services of the ZooKeeper service. In addition to the request handler, each server in a ZooKeeper server group replicates each component of their own.

ZooKeeper Components

image

The replicated database is a structure containing the entire data tree stored in memory. All update operations are logged to the hard disk. And the write operation will be serialized and stored on the hard disk when it is applied to the database.

Each ZooKeeper server is connected to many clients. Clients connect to a server to submit requests.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327063.htmlTechArticleFor more information, please check the zookeeper official website Zookper: A collaborative service for distributed applications Zookper is a distributed , open source, collaboration service for distributed applications. It provides a...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template