SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all,

    I have 2 tables which need to contain the same values. However, there are different queries running on each of them, so basically at some moment, I have to merge them (update any info that is different between the two)
    I just need the idea, please say it out if you have any!
    Thanks a lot.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  2. #2
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Son Nguyen

    Is this something a join could be used with?

    peace

  3. #3
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even worst, these 2 tables are on 2 different servers.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  4. #4
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    MySQL supports some form of replication -- perhaps that could be useful in passing down the information?

    When do you have to merge the information -- e.g. immediately as it happens or could you have some sort of lag between them, say every 24 hours?

    If so, you could write a script to basically lock the table in the main server and then read the information into the replication server. Unlock the tables and you're good to go.

    If you want it to be immediate (and by separate severs you mean separate physical machines and not just different instances / DBs on one box) then I'd write something that (in MySQL):
    Upon INSERT, UPDATE, and DELETE statements:
    1) Locks all tables on BOTH servers involved
    2) Change the info on one server, unlock
    3) Change the info on the other server, unlock


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •