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

How to realize the expansion and reduction of distributed Architecture in MySQL

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article introduces how to achieve distributed architecture expansion and reduction in MySQL, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.

The expansion and expansion of MySQL distributed architecture is a very interesting topic. Strictly speaking, the architecture we are talking about is a pseudo-distributed architecture, so let's call it a general term. The focus is on the idea of expanding and reducing capacity.

If the master and slave of an environment is complete and divided into multiple logical fragments, it is generally such an architecture.

This architecture uses 4 physical shards, and each physical shard has 4 logical shards, with a total of 16 logical shards, which means that a table is divided into 16 parts.

For capacity expansion, priority is given to writing to the main library, so our expansion can be based on the scale of 2N, such as 4 physical shards, which can be expanded to 8 physical shards. The general structure and distribution are as follows. At this time, the main library is made from the top of the library.

From the point of view of capacity expansion, this is what we expect to do, 4 to 8, 8 to 16. A set of environment can be expanded twice according to the set slicing scale.

We need to think more carefully about how to do the downsizing, so I intercepted a relatively detailed data replication diagram of physical shard 1.

Before capacity expansion, the four logical shards on the sharding node are all in active state and can be written to data. The slave database is inactive, which is only responsible for data synchronization.

After the expansion, the original db1,db2 is in active state, while db3,db4 is in active state on the original Slave node.

On this basis, what we need to ensure is to unify the isolated node data into the Masterside active state. This process is easy to say, but difficult to operate.

On how to achieve distributed architecture scaling in MySQL to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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

Database

Wechat

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

12
Report