Forum Moderators: open

Message Too Old, No Replies

Sharing database across domains on same server

Sharing a database

         

Boballoo

8:55 am on Sep 26, 2014 (gmt 0)

10+ Year Member



I want to set up a network of cctlds (mysite.ca, mysite.us, my site.jp, etc. - probably with Wordpress Multisite). There will be info and profile information specific to the cctlds that I will want to display but also needs to be available on the main site and the language/country page for the corresponding cctld. To avoid all the issues with updating dozens of separate databases I would like to use a single DB for all sites (or display info from the main DB on the cctlds and allow users to interact with the main DB while remaining on the cctld). I have been told it can't be done and it is a serious security risk. I have also been told it can be done and

"a single database can be used across multiple domains. But it would also require a single host for all those domains. That is all those domains should be linked to the example.com ftp."

I am curious and in need of some informed opinions. Your help would be appreciated.

[edited by: bill at 7:54 am (utc) on Sep 27, 2014]
[edit reason] use example.com [/edit]

LifeinAsia

3:14 pm on Sep 26, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Welcome to Webmaster World, Boballoo!

I don't know about WordPress, but Drupal (and I assume most other CMS packages) allows you to use an external database.

One of the main issues with using an external server is latency, especially with a CMS that hits the database a lot. You can somewhat compensate for that by setting up replication between the databases. For example, have one master DB that pushes out changes to one or more slave DBs. Each slave DB can be local to the web server referencing it. Use the master for writes and the slave for reads. That way only writes (usually a very small percentage of DB actions) will be affected by latency.

One question- is there a particular reason why you won't just host all the cctlds on the same server?

Boballoo

3:44 pm on Sep 26, 2014 (gmt 0)

10+ Year Member



"One question- is there a particular reason why you won't just host all the cctlds on the same server?" Thanks for the detailed answer. That is very helpful. However, I am hosting all sites and DB on the same dedicated server. I'm not sure why you say that. I want to serve all sites from the same database on one server.

LifeinAsia

4:59 pm on Sep 26, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I'm not sure why you say that.

In your OP you said you were told it can't be done because it would require a single host for all the domains. I took that to mean that you were being told it couldn't be done because you were NOT using a single host.

I've never used WordPress Multisite, but it sounds like that's exactly what it's designed for.

I'm curious as to who is telling you it couldn't be done. I hope it's not your hosting company. :)

Boballoo

10:52 pm on Sep 26, 2014 (gmt 0)

10+ Year Member



I can't name names here in public but a few programmers have said it is "a serious security risk" and therefore should not be done (which is different than "can't be done"). I also had one person tell me that it "can't" be done. That it was "impossible".

LifeinAsia

11:56 pm on Sep 26, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



When it comes to programming, "It can't be done" usually translates into "I don't know how to do it" or "I'm too lazy to do it."

Boballoo

7:39 am on Sep 27, 2014 (gmt 0)

10+ Year Member



Yes, I have come to that conclusion as well. I have found a few good, honest programmers who when confronted with a new idea do not automatically say "that won't work", but instead say, "I can check into it for you".

Boballoo

11:02 am on Sep 27, 2014 (gmt 0)

10+ Year Member



OK, here is another issue connected to this Database thing, if I have all my CCTLDS (~120) in the same database as the main site, what would I need in terms of hosting. What kind of power would I need on the server, I know you will say it will depend on the traffic and number of requests to the DB but can you give me some idea as I have none.

LifeinAsia

9:19 pm on Sep 27, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Well, it DOES all depend on the traffic and number of requests. :) The number of domains doesn't really matter- it's all an issue of the aggregate traffic that comes to them.

There are some hosting company with hundreds of domains on one server. Other domains require multiple servers to handle all the traffic.

I take it you don't have any traffic to them now? All you can do is guestimate the amount of traffic you'll expect to build up over the next couple of years and build from there.

GoNC

12:02 am on Oct 6, 2014 (gmt 0)

10+ Year Member



We have 70+ sites on multiple servers, with the MySQL database on a dedicated server. It's fast, and I'm not aware of any security problems that have come from it.

We use cPanel for each account, so it's a simple matter of allowing access to each IP.

Boballoo

12:22 am on Oct 6, 2014 (gmt 0)

10+ Year Member



Wow! Now that's the kind of confident and factual answer I was looking for. Thank you so much. That is the kind of set up I am working toward. I am just researching the SEO considerations of multiple servers for multiple CCTLDs in several countries.

GoNC

12:53 am on Oct 6, 2014 (gmt 0)

10+ Year Member



When we first set it up (many years ago), we had one site and one database. This was on a shared server until it became too demanding, so we moved both to a single dedicated.

Over time, we added more sites to the same server. As they grew, though, it became necessary to move larger sites to their own server. We originally had the database on the same server as the main site, but as that site grew in traffic we needed to either upgrade the server or lease another server just for the database. It was cheaper to put the database on its own server.

PHP, MySQL, and Apache optimization became a big part of the job, though. When thousands of Apache processes occur per second, an improvement of a few milliseconds can have a major impact on the servers. Currently, the average load time for our busiest site is about 2 seconds.

I haven't noticed any SEO issues stemming from this setup.

If it matters, our sites are all custom built using PHP, Perl, and MySQL, and as I mentioned before, we use cPanel for each account. We also use Munin on each server to watch for hardware demands or configuration issues.

Boballoo

1:17 am on Oct 6, 2014 (gmt 0)

10+ Year Member



That is very helpful. Thanks for taking the time to post. The network I am developing is a large group of CCTLDs under the main site. They will all be linked to the main .com site but will have languages specific to the county of the CCTLD. At some point we will add a server based in the country of the CCTLD thus making it a truly local site to attract local clients and local service providers.

erick3000

3:55 am on Feb 8, 2015 (gmt 0)

10+ Year Member



I've been using Percona XtraDB as cluster with 3 servers. Works like a charm. Never go down.

This will support over 20.000 people online at the same time on a worpress (read only).

That combined with an ip load balancer and a nfs for the 3 servers.

This will cost over $10.000 on the cloud yet i spent under $1000 a month

however hope that you never need support, xtraDB support package will cost you an staggering $17.000 (backups are your friend)

Anyways this could be a solution for you but if you are planing to go with local servers (as in per country) that is another story.