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

  • SEARCH
  • Home
  • 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 6796161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:26:01+00:00 2026-05-26T18:26:01+00:00

I am looking about the best way to implement a multi-sites replication with MySDQL.

  • 0

I am looking about the best way to implement a multi-sites replication with MySDQL. As I am mainly a MS-SQL user, I feel quite unconfortable with MySQL replication terminology, and the multiple MySQL versions that do not do exactly the same thing the same way.

My objective is, as per SQL terminology, to have a publisher and many subscribers. Suscribers are open to user updates. Changes are replicated with the publisher, which will then distribute these changes to other suscribers.

So my objective is here to determine the correct primary key rule to be used for our tables. As we want exclusively surrogate keys, we have the possibility to use either integer\autoincrement or uuid/uuid_short fields. In order to avoid replication conflicts, the integer\autoincrement does not fits our needs, as it can create replication conflicts when, between two synchronisations, both servers insert a record in the same table. So, according to me, the correct solution to avoid replication\primary key conflicts would be to:

  • use uuid or uuid-short fields as primary keys
  • have the corresponding uuid values set by the server at INSERT time
  • set the replication to RBR (Row Based Replication – sounds equivalent to MS-SQl merge replication) mode, and not SBR (Statement Based Replication – sounds like transactional replication). As I understand it, RBR will insert the calculated uuid value ‘as is’ in the other servers at replication time, while SBR will recall the uuid() function and generate a new value on each server … thus causing a major problem!

Will it work?

  • 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-26T18:26:01+00:00Added an answer on May 26, 2026 at 6:26 pm

    I think there are two unrelated issues here:

    1.

    Choosing a primary key in a way which is probably unique – UUID is an acceptable approach. You can use it with SBR or RBR, provided the client app generates the UUID. If you happen to be calling the mysql function to generate it, then you need to use row-based replication. Row-based replication is generally much better, so the only reason you’d want to use statement-based replication is backwards compatibility with a MySQL <5.1 slave, or legacy application which relies on some of its behaviour.

    2.

    Secondly, you appear to want to do multi-master replication. IT WILL NOT WORK.

    MySQL replication is extremely simplistic – it writes changes to a log, pushes them from one server to another, reading the log as needed.

    You can’t do multi-master replication, because it will fail. No only does MySQL not actually support it (for arbitrary toplologies), but it also doesn’t work.

    MySQL replication has no “conflict resolution” algorithm, it will simply stop and break if a conflict is discovered.

    Even assuming that your database contains NO UNIQUE INDEXES except primary keys which are allocated by UUIDs, your application can still have rules which make multi-master fail.

    Any constraints, invariants or assumptions within your application, probably only work if the database has immediate-consistency. Trying to use multi-master replication breaks this assumption and will cause your application to enter unexpected (i.e. normally impossible) states.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for some advice on the best way to implement the task below
Looking for some guidance on the best way to implement this scenario: I have
I'm looking for suggestions on the best way to implement a full-text search on
I am looking for the best way to go about testing the following static
I'm looking for some advice on the best way to implement a fivestar rating
Following Izb's question about Best binary XML format for JavaME , I'm looking for
I'm a front-end developer and I was looking for opinions about the best all-round
I've been looking into OSGi for a while and I'm wondering about the best
I'm looking to learn about embedded programming (in C mainly, but I hope to
I've been looking through the PRISM 2 samples for ideas about how to best

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.