Page 1 of 1
Different databases and sites.
Posted: Mon Aug 05, 2013 2:37 am
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.
Re: Different databases and sites.
Posted: Mon Aug 05, 2013 4:11 am
by requinix
Maybe. What are all these subdomains for? What's the difference between one and another?
Re: Different databases and sites.
Posted: Mon Aug 05, 2013 5:06 am
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?
Re: Different databases and sites.
Posted: Mon Aug 05, 2013 12:20 pm
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?
Re: Different databases and sites.
Posted: Tue Aug 06, 2013 3:33 am
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
Re: Different databases and sites.
Posted: Tue Aug 06, 2013 1:49 pm
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.
Re: Different databases and sites.
Posted: Tue Aug 06, 2013 2:04 pm
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?
Re: Different databases and sites.
Posted: Tue Aug 06, 2013 3:16 pm
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.
Re: Different databases and sites.
Posted: Wed Aug 07, 2013 2:39 am
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.