Different databases and sites.

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
User avatar
chris98
Forum Contributor
Posts: 103
Joined: Tue Jun 11, 2013 10:47 am
Location: England, United Kingdom

Different databases and sites.

Post by chris98 »

Hello, I am currently making different sites, (similar to heavengames), and I was wondering.Should I have all the sub domain sites on different databases, or should I have every site through one?

Any comments would be appreciated thanks.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Different databases and sites.

Post by requinix »

Maybe. What are all these subdomains for? What's the difference between one and another?
User avatar
chris98
Forum Contributor
Posts: 103
Joined: Tue Jun 11, 2013 10:47 am
Location: England, United Kingdom

Re: Different databases and sites.

Post by chris98 »

I am making a Stronghold fansite, and so far, I have a main site, (similar to heavengames), and a stronghold 2 subdomain, as well as a stronghold crusader one.(Not on the web YET) At the moment, I have them all through one database, and since I only have one forum, I was wondering what to do.

A.) Should I split them up to a forum for each subdomain site?

B.) Should I keep it the same?

C.) Should I keep the forum through a seperate one altogether?

Which would be the best way top lay it out?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Different databases and sites.

Post by requinix »

a) If you want to keep them separate from each other, yes, but most commonly there'll just be one forum for an entire site and you have subforums for the subdomains.
b) What I was trying to find out is whether the database structures would be the same. Same tables and same code with just different branding? Or do the subdomains behave differently with different purposes?
c) Separate what?
User avatar
chris98
Forum Contributor
Posts: 103
Joined: Tue Jun 11, 2013 10:47 am
Location: England, United Kingdom

Re: Different databases and sites.

Post by chris98 »

Yes, all the database structures would be the same, because I would just be using the same scripts for them.The sub domains would probably behave the same.They would have different purposes though.

By "seperate", I meant: Should I keep all the forums through a seperate subdomian altogether?

I.E. http://forums.YOURDOMAIN.com
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Different databases and sites.

Post by requinix »

chris98 wrote:Yes, all the database structures would be the same, because I would just be using the same scripts for them.The sub domains would probably behave the same.They would have different purposes though.
I'm inclined to say you should not use separate code, and that the subdomains work like internationalization where scripts rewrite like

Code: Select all

sub.example.com/rewritten/path -> /script.php?file=rewritten/path&subdomain=sub
Then your code can include that "sub" in its queries and whatnot when determining exactly what content to show.
chris98 wrote:By "seperate", I meant: Should I keep all the forums through a seperate subdomian altogether?

I.E. http://forums.YOURDOMAIN.com
If you want. I myself probably would.
User avatar
chris98
Forum Contributor
Posts: 103
Joined: Tue Jun 11, 2013 10:47 am
Location: England, United Kingdom

Re: Different databases and sites.

Post by chris98 »

Right, thanks, I might try that.But wouldn't it make it easier for an attacker then, if it's all through one database?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Different databases and sites.

Post by requinix »

You're running the same code. If there's a flaw on one site then it'll show on the other site too. And if you literally run the exact same code then it's actually better: you fix the bug for one site and it's fixed for all the others.

No net difference.
User avatar
chris98
Forum Contributor
Posts: 103
Joined: Tue Jun 11, 2013 10:47 am
Location: England, United Kingdom

Re: Different databases and sites.

Post by chris98 »

Right, thanks for your advice.I was just wondering what other people might think.If I need any help on it, I'll post back here.

Thanks.
Post Reply