Forum Moderators: coopster

Message Too Old, No Replies

How many MySQL databases on host do I need?

PHP with basic CMS and forums

         

picophd

5:42 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



Greetings,

I'm asking so that I know while searching for hosting plans (don't mind to get recommendations via sticky mail by the way): how many MySQL databases will I need for a website that should start with 100 pages of content (but to grow rapidly in content), which should be managed by a PHP CMS, and many images for demonstration, and finally forums?

dreamcatcher

5:48 pm on Nov 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi picophd,

In affect all you need is just the one database. You can use it for as many scripts as you like so long as each set of tables as a unique prefix. Failure to do this could result in the wrong file being updated. I find as a script developer that I like to have seperate databases for each script, that way you dont have to worry when you click 'Empty' on a table. ;)

There are some good hosting packages around that allow you more than 1 database. My own host has unlimited databases even for its basic package.

dc :)

Storyman

6:03 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



picophd,

You'll only need one MySQL db. I have access to unlimited dbs with my web hosting, but only use one per domain. Adding more dbs only means having to keep track of which db has which table.

Everyone is different so there are going to be developers on both sides of the fence in regards to 1 or many dbs.

What is more important is that you normalize your tables for fast response.

picophd

6:18 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



dreamcather, thank you. I took note of your point. :)

storyman, thank you. I also see what you mean. You're absolutely right, we acquire different habits and way of management as we go on.

I'm still a newbie to most of this, anyway, so I just have to wait and see which path or method I'm gonna like. But it's definitely great that I heard two sides of the story, or 2 ways of looking at the issue, so this can help me, God willing, in the future.

One question, though, can you tell me briefly what you meant by "normalize" the tables?

jatar_k

6:21 pm on Nov 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I like to run minimum 1 db per domain. It really does depend on what I am doing with it though. All of my sites have 1, a couple have 2 and on dedicated boxes we have a whole bunch. ;)

Storyman

6:40 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



picophd,

Basically, when you normalize a database you are creating tables so data that is repeated can be referenced using a call to the table along with the id number. For example, if you were building a database for you CD collection and want the artist, cd name, and song title represented. Both the artist and cd name could be used numerous times in regards to the song titles.

The idea is that you have a table for the artist and another one for the cd titles. That way in your song table you'd use a reference to the id number for both the artist and cd title rather than duplicating the information.

If you google 'normalize database' you will find a slew of information on best practices. Most people use only the first 3 steps of the process.

I hope that I was clear in that I too use only one database per domain in 90% of the cases. There are occassions that I'll use an additional db. For example, I prefer to give forums their own database.

oceanwave

4:39 pm on Nov 27, 2004 (gmt 0)

10+ Year Member



You only need 1 database in most cases. Some scripts even ask you for a prefix to add on to their tables, knowing that the database their script will be in, may be shared with other scripts (and the prefix will cause all of their tables to be grouped together).

However, if you are using Fantastico (some hosts offer this...it installs select scripts at a click of a button), Fantastico will only install a script if there is a separate database for each script. That has been the only time I needed more than 1 database.

picophd

4:54 pm on Nov 27, 2004 (gmt 0)

10+ Year Member



storyman, thank you very much. Yes, I searched for it and found lots of links, indeed. I believe I'll have to study more and more. :)

oceanwave, thank you very much. I definitely wanted to hear that, because I did encounter hosts offering Fantastico as part of their offers, and it is certainly important to know that I need a separate database for any of the scripts I need to install from it. That was good info, thanks again.