LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-15-2010, 01:16 PM   #1
Zetec
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, W7, openSUSE, Centos
Posts: 152

Rep: Reputation: 25
MySQL replication - tables truncating


Hi There,

I'm looking to create a MySQL replication using MySQL 5.1 and SSL. We plan to have a master - slave replication. We are planning to run this replication over a 1.5mb T1 connection (yes this could hurt!!!!) and are only in a testing / feasibility phase.

One problem I foresee with our replication setup is that our software application has a nightly routine in which truncates two tables totaling 130mb of database data.

I was thinking of two options:
  • Let the database truncate and replicate the 130mb every night
  • Somehow schedule the replication to pause between the database truncate update (once per day)

Option one isn't really a great option imo as it will not allow our customers to view the information they need whilst the truncate and replication is working. This could take some time over a 1.5mb connection.

Is option two possible? Will the replication be happy if it is paused at say 6pm and back on at 8pm with two tables truncated and populated with data? Will MySQL try to replicate all truncated data or just changes it finds? Unfortunately our application has been written with the truncate to perform some updates on the database. These two tables that truncate to not change too much. I'm hoping MySQL would be intelligent enough to see that only 10 records have changed in the truncated tables and update only those 10 records.

We are working on rewriting the application as so it doesn't truncate but this is a while away. For now I just need some form of replication.

Thanks in advance for any input.

Regards,

Jon
 
Old 09-15-2010, 01:21 PM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

I use MySQL master-master replication between two servers in the same LAN so I'm not going to make any statements about replication off site using the velocity you indicated I only want to say that as I have it set up I can 'down' one server for a week and it will synchronize when I bring it up again. So I assume that if the replication is set up correctly (and thoroughly tested) you shouldn't have any problems when the slave does'nt replicate for just the short time frame you're indicating.

Kind regards,

Eric
 
Old 09-15-2010, 03:12 PM   #3
Zetec
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, W7, openSUSE, Centos
Posts: 152

Original Poster
Rep: Reputation: 25
Hi Eric,

Thanks for the feedback. I'm going to test the truncation issue and see what happens. It is good to know that MySQL can deal with long periods of disconnections without issue. .

Regards,

Jon
 
Old 12-08-2010, 07:50 PM   #4
Zetec
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, W7, openSUSE, Centos
Posts: 152

Original Poster
Rep: Reputation: 25
Forgot to update this.

In the end I setup a statement based master - slave replication without any pauses. It works well with the truncate and has proven to be very reliable. Over a T1 a full db replication (130mb) takes around 30-40 mins, the nightly tuncate takes 16-18.
 
Old 12-16-2010, 01:32 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Quote:
Originally Posted by Zetec View Post
Forgot to update this.

In the end I setup a statement based master - slave replication without any pauses. It works well with the truncate and has proven to be very reliable. Over a T1 a full db replication (130mb) takes around 30-40 mins, the nightly tuncate takes 16-18.
Hi Jon,

I'm glad you got a solution that suits your needs.

Kind regards,

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql replication failed after mysql reboot ajayan Linux - Newbie 8 09-08-2010 11:00 AM
MySQL replication Padawan.AVT Linux - Server 4 06-16-2009 09:27 PM
mysql replication lord-fu Linux - Server 0 04-02-2007 08:38 AM
mysql reinstallation distorted by previous tables in /var/mysql mad4linux Linux - Software 0 10-04-2005 01:39 PM
mysql replication cheng Linux - Software 1 08-22-2002 02:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration