Database Hosted On A Different Server To Web Site

Discussion in 'Databases' started by MattBOnline, Apr 7, 2011.

  1. #1
    Hi,

    I have just added a MySQL Database to my web site hosted at GoDaddy.co.uk. I have never had any issues with the hosting of the web site, which is accessed as normal using FTP, as you would imagine.

    However, the MySQL Database is stored at a different server to my web site. I had previously understood from tutorials at YouTube that all files would be saved to my server, implying it would be located the same place as my web site.

    If I continue to use this service with the Database at a different server to my web hosting could I find limitations with what I can do?

    Is this standard practice for hosting a database? What problems could I run into?

    Matt.
     
    MattBOnline, Apr 7, 2011 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you look at large website's architecture you will see they have batches of machines each for different types of server and so having RDMS and Web Serv on two seperate machines is no issue at all.

    As to common practice for shared web hosting? I would really say it varies, one of the advantages from a hosts point of view is that if someone manages to snarl up the db server then yes any site using a CMS etc is taken down (as they would be using a single machine) but all sites/ pages that are not db dependant continue to function normally (which wouldnt be the case if they were on shared kit). Therefore in theory less complaining customers.
     
    AstarothSolutions, Apr 7, 2011 IP
  3. joshua_

    joshua_ Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is absolutely true. In fact, i recommended that you make a habit of always storing your database on a different server than your site server to increase performance. As far as the question on if this is common for shared hosting the answer is that it depends. From what I've heard, shared LAMP servers commonly store both the db and the site on the same server. For Windows/IIS shared servers it is fairly common to have a separate server for db's.
     
    joshua_, Apr 8, 2011 IP
  4. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #4
    That's nothing wrong with it at all, in fact it's also a reliability plus
     
    crivion, Apr 8, 2011 IP
  5. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #5
    This is going to be a little more than the question was asking. It really depends on the design of the website, database usage, bandwidth, visitors.

    If you host a database and web server separately and they are not directly connected you could easily have problems on all but the smallest of websites. I don't quite know how godaddy's servers are connected on the back end but I would assume it's in a way that allows for very low latency data transfer between them. If server A is hosted here and server B is hosting somewhere else and they have to communicate over the internet, there's going to be a bottleneck.

    There is no best solution as every website is going to be different and their database and resource requirements are going to be different.

    My 50,000 foot view of common bottlenecks, assuming the site is coded properly and the database is designed well.

    Website -> Database Latency and Bandwidth
    Website -> User Bandwidth
    Database Server Resources
    Website Server Resources

    For small sites, a single server with the both the database and website on it will most likely out perform most any multi-server setup. It's easier to administer and a better overall setup. This is because there is virtually no bottleneck in the website connecting to the database and the database has enough resources not to be bound. As long as the server's internet connection is sufficient, this is the simplest and most efficient setup. Once the database starts getting bogged down, it's time to get on better hardware or add a server, again assuming that there are no problems with the way the websites and databases are setup.

    For a website with more intensive database usage, but not necessarily more traffic, a separate dedicated server(s) would benefit as the bottleneck becomes the database Resources. The servers need to be connected by a high quality connection. Generally I would recommend a minimum of a full-duplex 10/1000 directly between the servers with high quality ethernet cards and with no more than 1 switch between them. Better yet is 10G ethernet or fiber or some of the other high quality direct connecting methods. If you get a slower connection between servers than these, you may as well go back to a beefed up single server setup. It will be cheaper and easier to manage.

    For a website with less database usage but higher traffic, multiple web servers generally distributed in different locations to benefit from geotargeting. These can be attached to a central database or each have its own replicated database, or if the database usage is low can have their databases on their own servers. Only consider this if the server resources are getting eaten up by the program that the websites are written in. Otherwise a higher bandwidth internet connection would be a better solution than multiple servers.

    I'll stay out of clustering, distributed systems, cloud based hosting, as these are a bit beyond the scope of the question.

    As to the reliability statement, 2 servers are half as reliable as 1. You now have 2 points of failure so if either server fails, they both fail. Until you get into high-availability setups, each server added, decreases the reliability of the entire system.
     
    jestep, Apr 8, 2011 IP