storing files on mysql database or on server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poopsy
    New Member
    • Nov 2006
    • 50

    #1

    storing files on mysql database or on server?

    hello all,
    i am developing a web application for my final year project where i will be able to download and upload files(more specifically, it will be papers and articles, mostly pdf files) from the web site. my problem is where to store the files. i have found out that i can upload and store the files on the mysql database itself or i can also store it on the server but i want to know which is better in terms of performance and security??
    thx for ur help
  • poopsy
    New Member
    • Nov 2006
    • 50

    #2
    plzzzz help..its urgent..

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Hi.

      The most common method of storing uploaded files on a server is to simply upload them to a directory on the server. This is usually the preferred method because of how easy this is to set up and because this makes the files very easy to handle. You can simply let the HTTP server serve them as any other file.

      The downside is that this puts the file in the hands of your OS, giving the file-system control over them. This can make them more difficult to manage and can cause security issues.

      Another method involves putting the files into a database.
      This requires a lot more effort on your part, to set up the database tables and manually store information on the files being uploaded.
      This also means that you have to manually fetch and assemble the files before you can serve them via your HTTP server, which can decrease performance.

      The upside to the database approach is increased control and security.
      You have absolute control over the data without having to rig the file-system of the host OS, and you have better control over how the data is stored. You could even split it up and decrypt it if you are dealing with sensitive data.

      Generally speaking, if you do not require the level of control and security the database approach offers, putting the files on the file-system is the better choice. It's easier to set up and usually offers better performance.

      And there are of course hybrid solutions, where the two methods are used together, but that's usually overkill.

      Comment

      Working...