当前位置:网站首页>Design of master-slave replication system
Design of master-slave replication system
2022-06-26 22:07:00 【Hua Weiyun】
copy (replica): Each node that stores the complete data set of the database . When there are multiple copies , Problems inevitably arise : How to ensure that all data falls on all copies ?
Each direction DB All writes of must be propagated to all copies , Otherwise, the copy will be inconsistent . The most common solution is master based replication ( Also known as Take the initiative / Passive or active / From copying ), Pictured -1.
1.1 Master slave replication principle
- Specify a replica as the primary replica or primary node . When the client DB Writing time , The request must be sent to the master copy , The primary replica writes new data to its local storage
- Other copies are called slave copies or read-only copies , From the node , Hot standby (hot-standby)[^i]. Whenever the master node writes new data to the local storage , Data changes will also be sent to all followers , be called Copy log (replication log) Record or Change flow (change stream). After each change log is obtained from the replica, it is applied locally , And strictly keep the same write order as the primary copy
- The client from DB When reading data , Queries can be executed on master or slave nodes . But only the primary node can accept write requests . Client angle , Slave nodes are read-only )
[^i]: Different pairs heat (hot), temperature (warm), cold (cold) Backup servers have different definitions . Such as PostgreSQL in , Hot standby (hot standby) It refers to the copy that can accept the client's read request . and Warm preparation (warm standby) Just follow the leader , But does not process any queries from the client .

This replication pattern is a built-in feature of many relational databases , Such as PostgreSQL(9.0 Version start )、MySQL、Oracle Data Guard and SQL Server Of AlwaysOn Availability Groups. And some non relational databases such as MongoDB、RethinkDB and Espresso It also supports master-slave replication . Master-slave replication is not limited to DB: image Kafka、RabbitMQ Such distributed message brokers also use .
边栏推荐
- Matrix derivation and its chain rule
- Application and Optimization Practice of 100 million level monthly live national karaoke feed service in Tencent cloud mongodb
- leetcode:6103. Delete the minimum score of the edge from the tree [DFS + connected component + value record of the subgraph]
- SAP Commerce Cloud 项目 Spartacus 入门
- Système de distribution Unity Composants en tissu (y compris les dépendances d'appel dynamique)
- Vulnhub's DC8
- leetcode:152. 乘积最大子数组【考虑两个维度的dp】
- 中金证券经理给的开户二维码办理股票开户安全吗?我想开个户
- About appium trample pit: encountered internal error running command: error: cannot verify the signature of (solved)
- Detailed explanation of nmap parameters
猜你喜欢

Data governance does everything

leetcode:141. 环形链表【哈希表 + 快慢指针】

AI intelligent matting tool - hair can be seen

Module 5 operation

Unity: the referenced script (unknown) on this behavior is missing“

线性模型LN、单神经网络SNN、深度神经网络DNN与CNN测试对比

Convolutional neural network (CNN) explanation and tensorflow2 code implementation

WP collection plug-in tutorial no thanks for WordPress collection of rules

亿级月活全民K歌Feed业务在腾讯云MongoDB中的应用及优化实践

Introduction of classic wide & deep model and implementation of tensorflow 2 code
随机推荐
Icml2022 | neurotoxin: a lasting back door to federal learning
【图像处理基础】基于matlab GUI图像直方图均衡化系统【含Matlab源码 1924期】
What is the “ How to remove a custom form list?
leetcode:152. Product maximum subarray [consider DP of two dimensions]
Usage of MGrid in numpy
Centos7编译安装Redis
Unity animation knowledge of Art
矩阵求导及其链式法则
Yolov6: un cadre de détection de cibles rapide et précis est Open Source
Vulnhub's DC8
【图像处理基础】基于matlab GUI图像曲线调整系统【含Matlab源码 1923期】
Pass note 【 dynamic planning 】
Fastadmin Aurora push send message registration_ Multiple IDs are invalid after being separated by commas
Introduction to operator
numpy中mgrid的用法
Installation avec homebrew dans un environnement Mac OS [email protected]
How SAP Spartacus default routing configuration works
Product design in the extreme Internet Era
Talk about my remote work experience | community essay solicitation
Leetcode (122) - the best time to buy and sell stocks II