In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what is java CAP Theory". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is java CAP Theory"?
What is CAP theory?
In July 2000, Professor Eric Brewer of the University of California, Berkeley, put forward the CAP conjecture at the ACM PODC conference. Two years later, Seth Gilbert and NancyLynch of Massachusetts Institute of Technology proved CAP theoretically, and then CAP theory became a recognized theorem in the field of distributed computing.
CAP theory is composed of the following three concepts, and in a distributed system, you can't have both of them, and you can only satisfy two conditions at the same time.
Consistency (C)
All nodes see the same data at the same time
All the database cluster nodes see the same data at the same time, that is, all nodes can keep the data synchronized in real time.
Availability (A)
Reads and writes always succeed
Read and write operations are always successful. That is, the service is always available, and even if a part of the cluster node fails, the cluster as a whole can normally respond to the read and write requests of the client.
Partition fault tolerance (P)
The system continues to operate despite arbitrary message loss or failure of part of the system
Although there is any information loss or failure in the system, the system continues to run. In terms of practical effect, partitioning is equivalent to the time limit for communication. If the system cannot achieve data consistency within the time limit, it means that a partition situation has occurred and a choice must be made between C and A for the current operation.
CAP tradeoff use
1. Keep CA and give up P
If you want to avoid the problem of partition fault tolerance, one way is to put all the data (related to transactions) on one machine. Although there is no 100% guarantee that the system will not go wrong, it will not encounter the negative effects caused by partitions. Of course, this choice will seriously affect the scalability of the system.
As a distributed system, giving up P means giving up distribution. once the concurrency is very high, the stand-alone service can not bear the pressure at all.
Like many banking services, it is true that P is abandoned and only a single minicomputer + ORACLE is used to ensure service availability.
2. Keep CP and give up A
As opposed to abandoning "partition fault tolerance", the opposite is to abandon usability. Once a partition fault tolerance is encountered, the affected services need to wait for a certain amount of time, so the system can not provide services during the waiting period.
As a distributed system, it is very possible to have problems with partition services. if some services are unavailable, the whole service cannot be used, this is not a good distributed system at all.
3. Keep AP and discard C
To give up consistency here is not to give up data consistency completely, but to give up strong data consistency. That is, it gives up the data consistency at the same time, and retains the final consistency of the data.
In the case of online shopping, for items with only one item in stock, if two orders are received at the same time, the later orders will be told that the goods are sold out.
In general, many distributed service systems adopt this scheme to ensure availability and distributed services, because some partition service problems are tolerated first, and finally through some compromise methods to achieve the final data consistency.
At this point, I believe you have a deeper understanding of "what is java CAP theory". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.