当前位置:网站首页>Consistency under distributed
Consistency under distributed
2022-06-13 07:30:00 【Muzijin】
Distributed consistency
The core is expandability
Through the service , Storage expansion , To improve the processing capacity of the system
By working with multiple servers , To complete tasks that cannot be completed by a single server
A single point of failure
In traditional architecture , Once a component in the system fails , This will make the whole system inoperable , In a distributed system , A single point does not affect the overall operation
No state
Only stateless services can meet the requirements that part of the machine downtime does not affect all , Demand that can be expanded at any time
CAP theory
A distributed system can only satisfy consistency
c consistency Uniformity
All nodes can see the same data at the same time
That is, after the update operation is completed and returned , The data of all nodes at the same time is completely consistent , It is equivalent to that all nodes have the latest version of data at the same time
Consistency is called atomic objects , Any reading and writing should look atomic Or serial , You can read the front content by writing the back reading , All read and write requests seem to be sorted globally
A Availability Usability
anytime , Reading and writing are successful
That is, the service is always available and normally responding
This can correspond to SLA agreement (N individual 9)
Any non failed node should be returned in a limited time
P Partition Tolerance Zone tolerance
In case of message loss or partition failure of some nodes, the distributed system can still continue to run
In case of network inaccessibility between certain nodes or network partitions , Still able to provide external services to meet the consistency and availability
Allow any number of messages to be lost between nodes , When the network is partitioned , Messages between nodes may be lost completely
CP
Discard availability , Pursue consistency and partition fault tolerance
zooKeeper That is to say CP Uniformity The core algorithm Zab Algorithm
I understand it :zk Adopt master-slave architecture , When the master node hangs up , An election will be held , The system is not available at this time ( Discard availability ), Characteristics of master-slave architecture , The master node data is copied from the node to provide read , Master node Provide write and read , And sending data to the slave node after each write , It is a typical read-write separation ( It meets the requirements of consistency and partition fault tolerance )
AP
Give up strong consistency , The pursuit of partition fault tolerance and availability
The vast majority of distributed architecture choices
Base Theory is also an extension of this foundation
summary
cap The three cannot be satisfied at the same time , Don't waste your energy on how to design a distributed system that meets all three , But to make a choice
It's usually choice AP and CP Strong consistency and final consistency are mentioned here (Base theory )
We often focus on how to maintain relative consistency , Improve system availability
Base theory
Base The theory is Basically Available ( Basic available ) Soft-state( Soft state ) Eventually Consistent ( Final consistency ) Abbreviation
Basic available : No pursuit CAP At any time in , Reading and writing are successful , But the system can basically run , Always provide services , Partial loss of performance is allowed ( The request may be Current limiting , Downgrade )
Soft state : Allow data in the system to have intermediate states , It is considered that this state does not affect the overall availability of the system
Final consistency : Data cannot always be soft , The consistency of a node must be achieved within a time period , Achieve final consistency
( Mention here ) Strong consistency
When the user updates , Any subsequent process access will return the latest updated value , This is the most user-friendly , But according to CAP theory , Need to sacrifice availability
summary
Base Theory abandons strong consistency , The implementation is basically available
Consistency algorithm
paxos:https://juejin.cn/post/6844903621499289613
raft : https://juejin.cn/post/6907151199141625870 Typical middleware : etcd
zab : https://juejin.cn/post/6978751402206052360 Typical middleware : zookeeper
边栏推荐
- Fundamentals of assembly language: register and addressing mode
- How to write an amazing design document?
- Calculate running total / running balance
- Pdf to word
- 6. system call
- How idea breaks point debugging
- Try to use renderdoc to view the shader code of UE
- B. I Hate 1111 (记忆化搜索 数论
- Word document export
- Learning notes of balanced binary tree -- one two pandas
猜你喜欢
量化框架backtrader之一文读懂Analyzer分析器
About database: pgadmin4 editing SQL window
关于#数据库#的问题:PGADMIN4 编辑sql窗口问题
Related operations under Oracle Database
JMeter encryption interface test
RT thread simulator lvgl control: button button event
平衡二叉树学习笔记------一二熊猫
Compilation and development process of Quanzhi v3s environment
Through the function seaborn cubehelix_ Palette build order palette
Tree list under winfrom treelist related
随机推荐
Tidb data migration (DM) Introduction
Issues related to C # delegation and events
The management practice of leading enterprises has proved that what is the core of sustainable development of enterprises?
[log4j2 log framework] sensitive character filtering
25个国内外文献数据库
The 'yarn' item cannot be recognized as the name of a cmdlet, function, script file, or runnable program
Functions about Oracle.
How is it that the income of financial products is zero for several consecutive days?
Redis learning journey - transaction
Redis learning journey - persistence
oracle问题,字段里面的数据被逗号隔开,取逗号两边数据
RT thread simulator lvgl control: button button event
Awk use
P6154 wandering (memory search
Priority analysis of list variables in ansible playbook and how to separate and summarize list variables
Redis learning journey --redis Conf details
nodejs文件模块fs
How to use clion to debug a project built by the make tool
It's called the next generation monitoring system. Let's see how awesome it is
P1434 [show2002] skiing (memory search