Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between master-master mode and master-slave mode in MySQL

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the difference between MySQL master-master mode and master-slave mode. It is very detailed and has certain reference value. Friends who are interested must finish reading it.

The principle of MySQL replication:

Distributing data to multiple systems is achieved by copying the data from one master host in Mysql to another (slave) host and executing it again

During replication, one server acts as a master server, while one or more other servers act as slave servers. The master server writes updates to the binary log file and maintains an index of the file to track log loops.

These logs record updates sent to the slave server. When a slaves server connects to the master server, it informs the master server of the location of the last successful update read from the server in the log. Slave server

Receive any updates that have occurred since then, then block and wait for the master server to notify you of new updates.

The ddl and dml operations of the master database in the master server are transferred to the slaves server through binary logs, and then these log files are re-executed on the master server, thus keeping the data information on the slave server and the master server synchronized.

MySQL master-slave mode is for master operation data, and slaves synchronize data in real time. On the contrary, for the slave operation, the master will not synchronize the data, which may cause data disorder and lead to master-slave failure.

The MySQL master mode is a slave server for each other, and each server is not only the other party's master server, but also the other party's slave server. No matter which one operates, the other will synchronize the data. It is generally used as a high disaster tolerance scheme.

The above is all the content of this article entitled "what is the difference between MySQL master mode and master-slave mode". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report