Ravani Posted October 4, 2010 Share Posted October 4, 2010 Hello everyone, At the moment I am busy with developing a CMS application. This CMS application will be hosted on my own server and it will be used for multiple sites. The reason why I want to keep it all with myself is because all sites have the same functionalities so the CMS doesn't need any changes. Now I wanted to hear your opinions about the database model. I was thinking about the possibilities of using one database for all the websites that are going to use this CMS application. However I'd like to know if there are any disadvantages to do this and if you guys have better alternative ideas? What I was thinking about was something like this: Table Customers ID: 1, Name: X ID: 2, Name: Y Table Content ID: 1, Title: test, Customer_id: 1 ID: 2, Title: test2, Customer_id: 2 ID: 3, Title: test3, Customer_id: 2 This would be a good solution for myself, because I'm planning to use some of the database content to generate statistics of all the websites. However when I think about this solution, it just looks too simple and with lots of sites it will create lots of rows in one table, which could cause a problem (I think?). So I'd like to hear what you all think about it Quote Link to comment https://forums.phpfreaks.com/topic/215133-database-model-for-cms-hosting-multiple-sites/ Share on other sites More sharing options...
Adam Posted October 5, 2010 Share Posted October 5, 2010 How many sites are you talking? Quote Link to comment https://forums.phpfreaks.com/topic/215133-database-model-for-cms-hosting-multiple-sites/#findComment-1119234 Share on other sites More sharing options...
fenway Posted October 5, 2010 Share Posted October 5, 2010 I'm always wary of sharing tables within a DB that have nothing to do with one another -- you can leave your CMS code alone, use the same table names, etc., but have a different DB from each customer. Quote Link to comment https://forums.phpfreaks.com/topic/215133-database-model-for-cms-hosting-multiple-sites/#findComment-1119262 Share on other sites More sharing options...
Ravani Posted October 6, 2010 Author Share Posted October 6, 2010 How many sites are you talking? Could be 100 or more. I'm always wary of sharing tables within a DB that have nothing to do with one another -- you can leave your CMS code alone, use the same table names, etc., but have a different DB from each customer. Thanks, our initial plan was the one I provided in the topic start, but we had a long discussion about it yesterday and we decided to go for one database for our standard CMS and one database for our customers, so same solution as yours. We worked out the database model for our CMS and tomorrow we will work out the database model for our customers. Quote Link to comment https://forums.phpfreaks.com/topic/215133-database-model-for-cms-hosting-multiple-sites/#findComment-1119585 Share on other sites More sharing options...
eran Posted October 7, 2010 Share Posted October 7, 2010 There's no problem in having a lot of rows in one table - that's what tables are for. MySQL can scale to hundreds of millions of table rows and beyond. As long as the tables are normalized - which means that data they store has the same structure for each, and that looks to be the case here - you are doing well. Something to consider though - will one costumer have more than one site? in that case perhaps have an intermediary 'sites' table that maps clients to sites and sites to content Quote Link to comment https://forums.phpfreaks.com/topic/215133-database-model-for-cms-hosting-multiple-sites/#findComment-1120028 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.