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 8912623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:14:59+00:00 2026-06-15T04:14:59+00:00

I developed a custom mechanism for real-time mySQL databases synchronization which provides higher reliability

  • 0

I developed a custom mechanism for real-time mySQL databases synchronization which provides higher reliability (data integrity) over time compared to the built-in mySQL master/slave replication.

The synchronization mechanism operates in periodic cycles routinely triggered every 5 seconds, constituted of the following phases:

  1. the master database is ordered to produce a dump file thru mysqldump
  2. the dump file is transmitted to a remote server, owning the slave database. This transfer exploits rsync‘s delta algorithm and data compression
  3. the remote server waits to receive an acknowledgment to proceed
  4. the remote server imports the received dump file into the slave mySQL database
  5. the remote server acknowledges the local server that the synchronization cycle has completed

To prevent any inconsistency between master and slave, the dump file drops the whole slave database calling mysqldump with --add-drop-database.

Since the slave imports the dump file without interrupting the mySQL daemon, I’m worried if during the time window after mySQL reads the drop database instruction from the dump file, and before mySQL completes the recreation of all the tables, a mySQL client trying to access the database for a table not yet recreated may fail his request.

May this happen, or during the recreation any eventual client trying to access the database is quietly paused apart until its request can be executed? And eventually, what solutions can be applied?

  • 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-06-15T04:15:00+00:00Added an answer on June 15, 2026 at 4:15 am

    To avoid pulling the rug out from under any clients that might be trying to connect to a particular database, the best approach might be to not DROP and CREATE the database with each refresh.

    A method that might prove more reliable is to load in data into alternate tables one at a time, then do a mass switch. For instance:

    CREATE TABLE __users (...);
    INSERT INTO __users (...) VALUES (...), ...;
    
    CREATE TABLE __things (...);
    INSERT INTO __things (...) VALUES (...), ...;
    
    RENAME users to _users, __users to users, things to _things, __things to things;
    DROP table _users;
    DROP table _things;
    

    The mass rename operation would be executed atomically if you get everything lined up correctly.

    You’ll either have to alter the names within the raw SQL dump itself, or dump into a format that’s more easily parsed, such as SELECT INTO ... OUTFILE and later restoring with LOAD DATA INFILE.

    Note that this approach will not handle VIEW or TRIGGER objects, among other things. It will only work with plain old tables. You’ll also need to have enough free space to create two copies of your entire database during the reload procedure.

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

Sidebar

Related Questions

I have developed a custom binding which works over http and therefore returns http
We have our own custom calendar in our portal which is developed in Java.
We have developed custom contols for TFS 2010, which deployed to visual studio and
Is there a mechanism to use Facebook Connect to authenticate via a custom developed
My Mojolicious application has some custom authentication mechanism, which I implement in a routing
We developed one custom workflow and custom portlet in which we apply this flow.
We have developed a custom WCF channel which communicates via IBM Websphere MQ. We
I developed a custom file manager for tinymce. But even if adding image to
I have developed a custom c# cmdlet. It has three parameters (all of them
I have developed a custom dijit Templated Widget. I have to do some DOM

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.