Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7682035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:28:29+00:00 2026-05-31T18:28:29+00:00

I currently have a MySQL dual master replication (A<->B) set up and everything seems

  • 0

I currently have a MySQL dual master replication (A<->B) set up and everything seems to be running swimmingly. I drew on the basic ideas from here and here.

Server A is my web server (a VPS). User interaction with the application leads to updates to several fields in table X (which are replicated to server B). Server B is the heavy-lifter, where all the big calculations are done. A cron job on server B regularly adds rows to table X (which are replicated to server A).

So server A can update (but never add) rows, and server B can add rows. Server B can also update fields in X, but only after the user no longer has the ability to update that row.

What kinds of potential disasters can I expect with this scenario if I go to production with it? Or does this seem OK? I’m asking mostly because I’m ignorant about whether any simultaneous operation on the table (from either the A copy or the B copy) can cause problems or if it’s just operations on the same row that get hairy.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:28:30+00:00Added an answer on May 31, 2026 at 6:28 pm

    Dual master replication is messy if you attempt to write to the same database on both masters.

    One of the biggest points of contention (and high blood pressure) is the use of autoincrement keys.

    As long as you remember to set auto_increment_increment and auto_increment_offset, you can lookup any data you want and retrieve auto_incremented ids.

    You just have to remember this rule: If you read an id from serverX, you must lookup needed data from serverX using the same id.

    Here is one saving grace for using dual master replication.

    Suppose you have

    • two databases (db1 and db2)
    • two DB servers (serverA and serverB)

    If you impose the following restrictions

    • all writes of db1 to serverA
    • all writes of db2 to serverB

    then you are not required to set auto_increment_increment and auto_increment_offset.

    I hope my answer clarifies the good, the bad, and the ugly of using dual master replication.

    • Here is a pictorial example of 4 masters using auto increment settings
    • Nice article from Percona on this subject
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have replication setup on MySQL 4.1 (master, named radius) to MySQL 5.0
I am currently running a traditional MySQL Master/Slave set up with about 90GB of
I currently have got 2 servers running mysql 5.1. Im settings them up as
I have a website that currently takes data from a mysql database and using
I currently have a MySQL database set up with a Java client accessing and
I currently have the following MySQL statement to replace the HTML entity for a
I currently have a news website setup in PHP/MYSQL that's a bit old and
I currently have a site which uses a MySQL 4.x schema, the site uses
I currently have a PHP form that uses AJAX to connect to MySQL and
Do you have any experience about this question? I have currently 1900 MySQL databases

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.