Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2005-04-04, 10:06 AM   #6
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
fam/rsync doesn't work with databases. Use Mysql Replication

Mysql 4.x is much easier to set up replication than 3.x used to be, and, Mysql 4.1 includes clustering which is the ultimate, but, isn't released as 'stable'.

devshed.org used to have a pretty good tutorial, but, I couldn't find it. Mysql's site isn't too bad with it.

With replication, you need to make sure you use atomic updates, although that's a pretty standard thing from a performance standpoint.

i.e.

update table set counter=counter+1 where domain_id=123;

rather than

select counter from table where domain_id=123;
php code to add 1 to $row['counter']
update table set counter=$row['counter'] where domain_id=123;

You'd be surprised how much code I run into that doesn't use atomic updates and they wonder why their stats are screwy.

other than that, once it is set, it is fire and forget. You can even shut down one machine or the other, and replication will spool things until the other server comes back.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:01 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc