Jump to content

Database model for CMS hosting multiple sites


Ravani

Recommended Posts

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 :)

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.