I'm currently looking to host multiple sites off one MySql database. Eventually I'd like to see hundreds of sites running off one database. Because I'm looking at such a large number of sites I don't think duplicating the tables within the database would work well.
Has anyone done this yet? I've found references that version 5 of PHP-Nuke would provide this type of functionality but I haven't been able to find anything concrete.
My current line of thought is to create site ID tables within the database. All page data would have to refer to a site ID.
I'm assuming that all modules and blocks would also have to be adjusted to incorporate the site ID.
If anyone has attempted anything like this I'd love to hear from you.
WD-40 Lieutenant
Joined: Dec 02, 2004
Posts: 231
Posted:
Fri Aug 19, 2005 2:02 pm
I believe most people have done or tried this. There's really nothing special in this case either. It's all configured via use of your config.php file.
Sincerley -
ssjones Nuke Cadet
Joined: Aug 11, 2005
Posts: 3
Posted:
Sat Aug 20, 2005 11:53 am
Is there a way to do this without altering the sql statements within the different php files?
You mention it can all be done in the config.php. I'm not sure how this would be done without changing the code within the different modules. If you could elaborate a bit I'd much appreciate it.
Thanks
Evaders99 Site Admin
Joined: Aug 17, 2003
Posts: 12383
Posted:
Mon Aug 22, 2005 8:38 pm
You just need the NukeSQL script to create tables with a specific prefix. And then use config.php to load whichever prefix you want.
If I were to have 100s of sites hosted off one database, and use different prefixes for the database tables in each site.....then I would end up with thousands of tables in my database. My assumption (someone please correct me if I'm wrong) is that MySQL will blow up if I have thousands of tables. Is this a correct assumption?
Based on the above assumption I concluded that I would have to modify the tables within the database (single prefix on the tables) to include a site ID and manage the data with a single database and a single prefix.
If MySQL can handle 1000s or 10,000+ tables then I could just use prefixes to solve the problem and it would save alot of headache.
Will MySql support such a large amount of tables?
edit:
Having thousands of tables really isn't feasible to manage...so I'm really looking to use one DB and a single table structure for the sites.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum