notes
3, Distributed Systems CAP principle of common interview questions and select the registry
Description: CAP explain the principles of answers and select the interview registry
case of CA meet, because P can not be met:
data synchronization (C) takes time, but also normal the response time (a), then the number of the machine would be less, so that P does not meet
the meet the CP, the reason can not be met a:
data synchronization (C) takes time, but also the number of machines plurality (P), but the synchronization data takes time, it can no longer be within the normal response time, it does not satisfy a
case where the AP satisfied, because C can not be met:
the number of machines are mostly (P), in response to (a) the normal time, the data can not be timely synchronized to other nodes, so C does not meet the
registration center to select:
Zookeeper: the CP design to ensure the consistency of the time, built the cluster, a node failure, leader election row will be carried out, or more than half of the node is not available, can not provide the service, and therefore can not meet the availability
Eureka: AP principle, master-slave node, a node linked to, other nodes can use the automatic switch, to the center
Conclusion Distributed systems P, it must meet, so only CA in a second election
is not the best choice, the best choice is to architecture design based on business scenarios
if required consistency, then select zookeeper, such as the financial industry
if go to availability, the Eureka, such as the electricity supplier system
Start