View Single Post

   
  #4 (permalink)  
Old 01-18-2008, 07:58 PM
Doesn't Work At McDonalds
 
Posts: n/a
Default Re: Most Efficient Directory Structure?

H.Xu wrote:
> Why not store files themselves in a database? Then you do not need to
> worry about too many files. You may worry about backup though.


First, it's an automatic performance hit. Retrieving the file from the
database and serving it programatically requires more CPU and disk
activity than directly linking to the file. That means slower serving
and more wear and tear on the server.

Second, I've had a very large database and the larger it got, the more
maintenance had to be done on it to keep things flowing smoothly.

Third, IIRC, most filesystems have a maximum size for a single file and
the database "data" is kept in one file per table. So, if that limit
is 4 gigs, then I'd have to create a new table each time I started
approaching the 4 gig limit. On a 500gb drive with 400 gigs allocated
to files, that would require distributing the files across 100 tables.
The mechanisms needed to manage that would create additional overhead
to slow things down.

Reply With Quote