multiple servers handling a mysql database?

Discussion in 'MySQL' started by LanceT, Apr 17, 2007.

  1. #1
    Anyone know how to wire servers so there are multiple servers handling a single mySQL database?
     
    LanceT, Apr 17, 2007 IP
  2. saidev

    saidev Well-Known Member

    Messages:
    328
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    140
    #2
    are you referring to master-slave setup to gain better database performance and liability or are you talking about physical "wire" two servers together?
     
    saidev, Apr 17, 2007 IP
  3. LanceT

    LanceT Peon

    Messages:
    279
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    To be honest I'm not quite sure myself. I am predicting that I will have a mySQL database that is very large (lets say several million rows - this is hypothetical), and basically I'm thinking that this kind of setup would be very demanding.

    Because of this, I'm wondering if I can balance the server load amongst two or more servers, or perhaps I can just split up the database into TWO separate databases on two different servers. Wondering how this can be implemented into your everyday PHP script.
     
    LanceT, Apr 17, 2007 IP
  4. saidev

    saidev Well-Known Member

    Messages:
    328
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    140
    #4
    If you want a high availability mysql database server, I would recommend the Master and slave setup with replication.

    Here is how it is going to be like,
    server 1 - master database
    server 2 - slave database that replicate server 1

    For php script, insert must be done on master database as it will communicate all to all the slave for the insert. If you application contains many database intensive reports, you can actually read off the slave database so your master database resource is free for the rest of the application. Once you need more power, add another server and set it up as another slave. This should provide you the scalability you are looking for.
     
    saidev, Apr 19, 2007 IP
  5. charlinks

    charlinks Guest

    Messages:
    125
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Also... I would recommend looking into SQLite... it's not as common but it's a lot faster and efficient than MySQL.
     
    charlinks, Apr 19, 2007 IP