* CAP theorem : It means in ⼀ In a distributed system ,Consistency(⼀ Consistence ),
Availability( can ⽤ nature ),Partitiontolerance( Partition tolerance ), The three cannot be obtained at the same time
⼀ Consistence (C): All nodes can access the latest data
can ⽤ nature (A): Every request can be answered , Whether the request succeeds or fails
Partition tolerance (P): Except for the whole ⽹ Network fault , Other faults cannot lead to the unavailability of the whole system ⽤
*
CAP The theory is that in distributed storage systems , It can only be realized at most ⾯ Two points of .⽽ Due to the current ⽹ Network hardware will certainly have problems such as delay and packet loss , So partition tolerance is what we must achieve . So we can only ⼀ Consistency and feasibility ⽤ Between sex ⾏ balance
CA:
If not required P( Partition not allowed ), be C( strong ⼀ Consistence ) and A( can ⽤ nature ) It can be guaranteed . But give up P At the same time, it means giving up the scalability of the system , That is, distributed nodes are limited , No way to deploy ⼦ node , This is against the original intention of distributed system design
CP:
If not required A( can ⽤), Each request needs to be strong between servers ⼀ To ,⽽P( partition ) Will cause synchronization time ⽆ Limited delay ⻓( That is, wait for the data synchronization to complete before accessing the service normally ),⼀ Dan fa ⽣⽹ Network failure or message loss , You have to sacrifice ⽤ User experience , Wait for all data ⼀ I'll let you know when I do ⽤ User access system
AP: want ⾼ can ⽤ And allow partition , You need to give up ⼀ Consistence .⼀ Dan subarea hair ⽣, Nodes may lose contact , in order to ⾼ can ⽤, Each node can only ⽤ Local data provision services ,⽽ This will lead to the inconsistency of global data ⼀ Consistence
* often ⻅ Registration in progress ⼼:zk,eureka,nacos
 NacosEurekaConsulZookeeper
⼀ Consequent agreement CP+APAPCPCP
health examination TCP/HTTP/MYSQL/Client Beat⼼ jump TCP/HTTP/gRPC/CmdKeep Alive
Avalanche protection Yes No
access protocol HTTP/DNSHTTPHTTP/DNSTCP
SpringCloud integrate ⽀ hold ⽀ hold ⽀ hold ⽀ hold
*
Zookeeper:CP Design , Guaranteed ⼀ Consistence , When the cluster is built , A node fails , Will enter ⾏ election ⾏ of leader, Or more than half of the nodes cannot be ⽤, be ⽆ Legal provision of services , But therefore ⽤ Sex can't be full ⾜
* Eureka:AP principle ,⽆ Master slave node ,⼀ A node hung up ,⾃ Switching other nodes can make ⽤, Go in ⼼ turn
* conclusion
In distributed system P, It must be full ⾜, So only in CA in ⼆ choose ⼀
There is no best choice , The best choice is to enter according to the business scenario ⾏ architecture design
If required ⼀ Consistence , Then select zookeeper/Nacos, as ⾦ melt ⾏ trade CP
If required ⽤ nature , be Eureka/Nacos, Such as e-commerce system AP
CP : fit ⽀ pay , Transaction class , Strong data requirements ⼀ Consistence , Prefer business to ⽤, No dirty data is allowed
AP: interconnection ⽹ business ,⽐ Such as information flow architecture , Strong data is not required ⼀ To , Want more service ⽤

Technology
©2019-2020 Toolsou All rights reserved,
evo Tool usage problems ——Degenerate covariance rank, Umeyama alignment is not possible Experiment 4 Automated test tools - software test mysql Export data sql sentence _mysql according to sql Query statement export data Create a thread ——— Javaweb (3) Data structure experiment ( three )—— Stacks and queues TS stay vue2 Writing in the project web Front end signature plug-in _signature_pad Plug in implements electronic signature function docker Where is the image stored Qt Getting Started tutorial 【 Basic controls 】QCalendarWidget calendar control springboot How to get reality in ip address