Forum Moderators: coopster & phranque

Message Too Old, No Replies

Perl and MySQL

what is better one big table or 100's of smaller ones?

         

ogletree

3:52 pm on Aug 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



My programmer and I are having an argument about what is a better practice one huge well indexed table or 100's of little ones. His point is that creating tables on the fly is a bad idea. Tables will only be created once when a new site is added. He wants the db set up from the begining and no new tables are ever created. We will be using mod_rewrite/perl to search these table. We both agree that my idea will be faster but his logic is that if we need a new server then we will be making so much money it won't matter. This server will be hit pretty hard to start out with. We get over 40K page views a day to begin with and expect a lot more.

jatar_k

4:01 pm on Aug 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> what is a better practice one huge well indexed table or 100's of little ones.

Both work, hopefully by 'better practice' you mean faster, more robust and the most scalable. If there will be increasing amounts of data then at some point the single table will become unusable.

>>His point is that creating tables on the fly is a bad idea.

Why? If you are creating them all the time, then I agree it could be but if it is only once in a while I don't see any issue.

>> Tables will only be created once when a new site is added.

How often is that?

>> He wants the db set up from the begining and no new tables are ever created.

Unrealistic, at some point you are going to have to create a new table.

>> if we need a new server then we will be making so much money it won't matter.

This approach is true to a point. You can't be lazy and create bad structures and lazy code just because you can throw hardware at it later. The key is to minimize costs and create a program/db that is scalable and powerful which will give the present setup a longer lifespan.

Though at some point even a perfectly designed system needs hardware thrown at it, hopefully. ;)