mysql_replication - What to do if a single writing database cannot meet the performance requirements when mysql reads and writes are separated?
学习ing
学习ing 2017-06-20 10:05:42
0
2
835

What to do if a single writing database cannot meet the performance requirements when mysql reads and writes are separated? Should I use multiple databases to write? So how to synchronize data and ensure data consistency?

学习ing
学习ing

reply all(2)
代言

You can try caching. When setting up data storage in the background, set it directly into redis, and then synchronize the database. When fetching data at the front desk, go directly to redis and get it. Personal suggestion, for reference only

学霸

When read and write separation cannot meet the performance, horizontal splitting is usually used to solve the problem:

主1 - 从1.1、从1.2、从1.3
主2 - 从2.1、从2.2、从2.3
...

In addition, the separation of reading and writing cannot guarantee data consistency. For example, if the user logs in just after registering, if the login reads from the slave database, then when the user logs in just after registering, but the registration data has not yet been synchronized to the slave database, Login will fail.

On the contrary, simple horizontal split will not have the problem of data inconsistency, because a piece of user data always falls in one partition.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!