Support » Plugins » Hacks » host wordpress database in an other server

  • Hi,

    I wonder if we can host wordpress database (mysql) in an other server which is not the server storing the content (source code, uploads files, plugins, theme…)

    Will that make any performance and security improvement? Is there any service specialized in hosting only database?


Viewing 5 replies - 1 through 5 (of 5 total)
  • Yes you can do that. The only real change you’ll need ot make is that you’d change your DB connection details on your wp-config.php file to point to the remote server instead of ‘localhost’.

    As far as performance, it might make a difference, but there’s a couple of factors. If the site is DB-intensive then offloading the DB to a separeate server will help performance (assuming that the DB server is tuned for DB performance). Alternatively, if the DB interaction is not high you might get longer loading times due to increased netowrk latency by sending the requests to a remote server. You’ll need to do your own testing to see if it works for you or not.

    thanks, I ‘ve been researching. I think this can significant increase the load time because the data will be transferring over the internet connection which is not better than directed HDD access. I would conclude that this solution will never work even if you host the database in a high-end server. If you plan to just host the database in an other shared host or even VPS, dedicated server, it will never work well.

    There is clustering solution that may work for this idea.

    No, that’s not correct in all situations. It may be true, but there’s a lot more to it then just that. You’d need to look at the hardware that both servers are running, the network that they are running on, the connections that can be achieved, and the queries that are being passed around. Both situations may work faster in different situations – I’ve personally seen both scenarios before, so I know first hand that there’s on single answer to that question unless you actually test it for yourself in your own situation with your own hardware.

    I think there is a case that it works, that is when the connection between 2 servers is very good.

    For my situation, My visitors a mostly come from Thailand. I have 2 shared hosting accounts, one is located in the US, one is located in Thailand. They are too far from each other and their connection will be delayed over the long distance. I think I can assure 100% it won’t work. Anyway, I still need your advices, if you encourage me, I will try to see how it proceed…


    It doesn’t matter where the visitors are from, you’ll have the same server load if they are in the next otwn or across the world.

    In your situation, hsoting the database externally is not going to help. The reaosn for that is the distance between the two servers. If the servers were in the same data centre then it can help, but you’d be creating too much communication time between the two servers to make it worthwhile. And as they are both shared hosting accounts, neither of them are set up to be a dedicated DB server so won’t work anywhere near as efficiently as they should.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘host wordpress database in an other server’ is closed to new replies.