ZooKeeper Is very popular , There's a basic question ：
OK, Answer the question above ：（ Here's what I said intuitively ）
That's all it says , To sum up ,ZK Distributed application development can solve the problem ,ZK Can solve the problem very well . To this step , There are more questions ：
Note： This article wiki It is to solve the first question .（ Other questions will be in other blog Step by step ）
An application , When multiple processes are involved in collaboration , There are a lot of complex process collaboration logic in business logic code .
The above multi process collaboration logic , Yes 2 Characteristics ：
therefore , Consider the common problems of multi process collaboration , As infrastructure , Give Way RD More focus on business logic development , namely ：
ZooKeeper It is one of the basic services of multi process cooperation .
ZooKeeper There are several simple features ：
ZooKeeper It's a storage facility , But pay special attention to
Metadata）, Instead of applying data , Application data has its own storage scheme , for example HDFS etc.
In particular ：
Application data and metadata , Due to different scenarios , There are differences in requirements for consistency and persistence , therefore , Architecture design 、 In the process of data governance , Should be 2 Class data is viewed independently 、 Independent storage .
ZK The core problem to be solved ：
ZK The goal is ： Simplify distributed application development , Multi process collaboration problem . For distributed applications , Provide
reliable The distributed coordination service （ Basic services ）, for example ：
A simple question ： What is multi process collaboration ？ Nima , Over and over , You have everything , Facing this crazy skull , Let's answer .
Multi process collaboration , The whole is divided into 2 class ：
In particular ：
Multi process collaboration across networks , Process of communication , The basic idea is 2 individual ：
Shared memoryProvide orderly access to ,ZK In this way
In real systems , Cross network communication , There are several common problems ：
ZK Carefully designed for Block the above 3 A common problem , Make these problems completely transparent at the application service level .
Consistency of distributed systems ：
under these circumstances , How to ensure data consistency ？
The highest priority node（ The node that contains the latest data ）
Paxos The goal is ： solve
Distributed consistency problem , Improve distributed systems
Fault tolerance The consistency algorithm .
Paxos The essence ： be based on
The messaging Of
Highly fault-tolerant Of
ZooKeeper yes ：
Business logic development, And you don't have to pay too much attention to
Details of distributed inter process collaboration
ZooKeeper No direct exposure
The original language , It is , Expose a part of
Calling method Composed of API, File system like API, Support applications to implement their own
The original language .
ZooKeeper The following distributed consistency features can be guaranteed ：
ZooKeeper Committed to providing
High performance 、
High availability 、
Sequential consistency The distributed coordination service , Guaranteed data
Final consistency .
A tree structureOrganize data nodes ;
ZK Before appearance , There are two ways of distributed system , Achieve multi process collaboration ：
ZK More focused on process collaboration , It does not provide any lock interface and general storage data interface .（ doubt ：ZK It can also be provided , We don't need to use it ）
application server , common 2 Needs ：
ZK For the above 2 These strategies provide the basis API.
ZooKeeper Scenarios that are not applicable ：
special FS, but ZK Used to store
Metadata, It needs to be stored separately
Why don't I fully advocate self-study ？
① Daniel on the platform basically has many years of working experience , Have you ever thought about the threshold of the industry before , What is the industry threshold now ？ In the past, enterprises did not have such high requirements for programmers' ability , Even more than a decade ago, if you could write “Hello World”, You can get started in this industry , So you can get started before .
② Now there are some excellent young cattle , They may also be self-taught , But they must have excellent learning ability , Excellent self-management skills （ time management , Meditation, persistence, etc ） And be good at finding and summarizing problems .
If you think your goal is very clear , Can you do the first ② The points mentioned in point , In the current market , You are really suitable for self-study .
besides , For most people , Registering for a class must be the best way to grow quickly . But there's a problem , At present, the quality of training institutions in the market is uneven , If you don't find a good training class , It's a total waste of energy , Time and money , This needs to be selected by yourself .
I personally suggest that online is more cost-effective than offline , The price of offline training is basically unchanged 2W You can't get down , Online education is now more mature , During this outbreak , Students have basically experienced the online learning mode . Compared with offline , The advantages of online are mainly in the following aspects according to my understanding ：
① Price ： The online price is basically half of the offline price ;
② teacher ： Relatively speaking, the teachers of online education are stronger and richer than offline education , Better coordination of resources ;
③ Time ： Learning time is relatively free , Don't learn naked words , Suitable for learning while working , Reduce the stress of life ;
④ Course ： In terms of course content , It really goes deeper than offline .
What technologies should be learned to meet the requirements of the enterprise ？（ The following figure summarizes ）