Synchronise data in two databases

This is a discussion on Synchronise data in two databases within the MySQL Database forums, part of the Database Forums category; Hello. is there a good way of synchronizing two MySQL databases so they hold the same data? Basically, I've ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-04-2006
Peter Chant
 
Posts: n/a
Default Synchronise data in two databases

Hello.

is there a good way of synchronizing two MySQL databases so they hold the
same data? Basically, I've created a family tree in php/MySQL and I'd like
to use it at two locations. Unfortunately my parents don't have broadband,
so using it on-line over the internet is not really practical, it ties up
the telephone for two long.

Master-master replication looks like it might do the trick. However, I'm a
bit concerned, as it would appear that this is intended for databases that
have a permanent or semi-permanent connection between themselves. On of
the databases being run and connected at intervals between daily and
monthly, on an ad-hoc basis is I'm sure not what the mysql developers
intended.

Master-slave replication would not do the trick, as I cannot update the
disconnected slave.

Perhaps I should at the outset forgone databases and stored the data in a
collection of files copied across using rsync.

I've also seen a number of products to synchronise databases, but these seem
to be mandraulic and aimed at updating production databases by comparing
them agaist development code.

Any thoughts? My best plan at the moment would seem to be to rewrite the
databases, lengthening the primary keys with a prefix, say A_<key> and
B_<key> where A and B are the servers. I could then write a script to
compare the contents of both databases and copy any ommissions from one two
the other. I note I could not simply delete records, I would have to keep
a record but mark it deleted to I could be sure that both databases noted
the deletion.

Any thoughs, I am sure this is not the first time this issue has arisen?


Pete


--
http://www.petezilla.co.uk
Reply With Quote
  #2 (permalink)  
Old 05-04-2006
Bill Karwin
 
Posts: n/a
Default Re: Synchronise data in two databases

Peter Chant wrote:
> is there a good way of synchronizing two MySQL databases so they hold the
> same data?


Have you seen this?
http://www.daffodildb.com/replicator/index.html

Regards,
Bill K.
Reply With Quote
  #3 (permalink)  
Old 05-05-2006
Peter Chant
 
Posts: n/a
Default Re: Synchronise data in two databases

Bill Karwin wrote:

> Peter Chant wrote:
>> is there a good way of synchronizing two MySQL databases so they hold the
>> same data?

>
> Have you seen this?
> http://www.daffodildb.com/replicator/index.html


Cheers Bill, looks just the ticket. I need to do a bit of reading up of
course.

Pete

--
http://www.petezilla.co.uk
Reply With Quote
  #4 (permalink)  
Old 05-05-2006
Peter Chant
 
Posts: n/a
Default Re: Synchronise data in two databases

Peter H. Coffin wrote:

> How many people update this database regularly? If it's just you, a
> normal dump/restore will do just fine. You take a snapshot with you, on
> your laptop or whatever, then restore it when you return.
>


Yes,

just me, but there is a slim possibility of my mother or brother adding to
it as well. You have stated probally the most pragmatic solution, I've
been a bit more brute force about it and simply stopped the database and
put the mysql data directory onto a usb stick. However, I'm a bit
concerned that someday I will copy the data the wrong way and overwrite the
news with the old. Also I'd like something a bit neater.

Pete

--
http://www.petezilla.co.uk
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:49 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0