Srini wrote:
> Which is more efficient? Why??
> Storing or Reading a file in database or on to disk in a web server
> environment? considering all things like network, connections, memory
> are ideal.
>
> My knowledge says that using database is more efficient but few my
> pierce argue that storing in disk is more efficient when concurrent
> people accessing it...
There is a myth among many web developers that storing files
in database kills performance.
And my guess is that ASP accessing an Access 95 database on
a Pentium running NT 4 possible did.
But things are different today. With some good hardware and
a good database, then you should be able to get good
performance out if storing files in the database.
And it is so much easier to ensure data integrity and
administer the database solution.
I once did some experiments on the topic. The results are
attached below.
They are ASP.NET against MySQL, but technologies should
not matter much.
Arne
==================================================
File (1 threads): 1,9 get per second
File (10 threads): 2,2 get per second
File with web app cache (1 threads): 6,6 get per second
File with web app cache (10 threads): 16,1 get per second
File directly by web server (1 threads): 17,6 get per second
File directly by web server (10 threads): 20,1 get per second
Database (1 threads): 10,7 get per second
Database (10 threads): 11,8 get per second
Database with web app cache (1 threads): 15,4 get per second
Database with web app cache (10 threads): 19,6 get per second
File (1 threads): 1,9 get per second
File (10 threads): 2,2 get per second
File with web app cache (1 threads): 16,7 get per second
File with web app cache (10 threads): 19,4 get per second
File directly by web server (1 threads): 17,1 get per second
File directly by web server (10 threads): 20 get per second
Database (1 threads): 10,7 get per second
Database (10 threads): 11,9 get per second
Database with web app cache (1 threads): 17,3 get per second
Database with web app cache (10 threads): 19,6 get per second
File (1 threads): 1,9 get per second
File (10 threads): 2,1 get per second
File with web app cache (1 threads): 16,8 get per second
File with web app cache (10 threads): 17,8 get per second
File directly by web server (1 threads): 17,6 get per second
File directly by web server (10 threads): 20,1 get per second
Database (1 threads): 10,7 get per second
Database (10 threads): 11,6 get per second
Database with web app cache (1 threads): 17,1 get per second
Database with web app cache (10 threads): 19,5 get per second


|