imgmedia
By:
imgmedia

Multiple Sites - Accessing One Database

June 4, 2015 1.8k views
PHP DNS MySQL WordPress VPN Scaling Ubuntu

I have an interesting scenario that i am trying to figure out the best approach for. I have searched digital ocean community a bit to see if this topic has already been discussed and wasn't able to locate anything. My apologies if this scenario has already been discussed.

I have a Word Press site (SITE A) that is our main site. This site is used for real estate and downloads all of the listing information into the local WordPress database using a php we have written. The script runs every hour.

We also have several other sites (SITES B, C, D, E &F) that are all hosted on their own droplets. These sites have their own local database on their own respective droplets. These sites also reference the SITE A database in order to pull in information about certain properties.

Our idea is this. We would like to Separate the WordPress Installation and Database for SITE A. We will create a separate Droplet that we can easily scale for SITE A allowing SQL to not have to share resources.

Our question is simply, understanding that SITES B,C,D,E & F also access the database from SITE A, including that they access their own respective database, what is the best way to configure this where there is efficiency and speed without having a huge lag time between response from sql and the application displaying in the browser. Which is an issue we currently suffer from.

Any advise and help would be greatly appreciated.

1 comment
  • DigitalOcean has a feature to enable "Private Networking" between droplets. This would let sites (droplets) B,C,D,E & F access droplet A via a local network.

    Theoretically this would give you much faster speeds, as you can tell droplets B,C,D,E & F to use the local address rather than the WAN address.

    Or take it one step further, and have one droplet that is ONLY a database server.

2 Answers

This question was answered by @sierracircle:

DigitalOcean has a feature to enable "Private Networking" between droplets. This would let sites (droplets) B,C,D,E & F access droplet A via a local network.

Theoretically this would give you much faster speeds, as you can tell droplets B,C,D,E & F to use the local address rather than the WAN address.

Or take it one step further, and have one droplet that is ONLY a database server.

View the original comment

This question was answered by @sierracircle:

DigitalOcean has a feature to enable "Private Networking" between droplets. This would let sites (droplets) B,C,D,E & F access droplet A via a local network.

Theoretically this would give you much faster speeds, as you can tell droplets B,C,D,E & F to use the local address rather than the WAN address.

Or take it one step further, and have one droplet that is ONLY a database server.

View the original comment

Have another answer? Share your knowledge.