2

Dear All, I am developing an automative tool.for this I need file attachement functionality.Back end using Mysql 5.2,Appache tomcate server.Can any body suggest me uploading file to DB is better OR uploading it to server is better. Thanks in advance.

jmj
  • 237,923
  • 42
  • 401
  • 438
user696225
  • 21
  • 1

3 Answers3

3

Read this post for which is best .Meanwhile may i know what kind of file(image,movie,text doc) , what is it's file size?

File paths in the DB is definitely the way to go

Storing Images in DB - Yea or Nay?

HighLights:

  • Database is for a structured data.
  • Long Run performance hit and backup .
  • Small static images (not more than a couple of megs) that are not frequently edited, should be stored in the database. This method has several benefits including easier portability (images are transferred with the database), easier backup/restore (images are backed up with the database) and better scalability (a file system folder with thousands of little thumbnail files sounds like a scalability nightmare to me).

File store. Facebook engineers had a great talk about it. One take away was to know the practical limit of files in a directory.

Needle in a Haystack: Efficient Storage of Billions of Photos

Community
  • 1
  • 1
Dead Programmer
  • 12,427
  • 23
  • 80
  • 112
  • Only .txt .docand .xls files.IN My DB i am using longtext data type for 4 columns of different table.How abt using using DB again for uploasing(of size not more than 20MB).PLaese help me – user696225 Apr 11 '11 at 05:11
1

Uploading the file to the server and having an entry for its path in the DB is a better approach.

asgs
  • 3,928
  • 6
  • 39
  • 54
1

DBMS has following advantages

  • You can access it from multiple site, if you store in FS you need some protocol to transfer it

  • With DBMS you will have relation things directly while for FS you need to manage it programatically

  • With DBMS you can have advantage of ORM.

My vote goes to DBMS

jmj
  • 237,923
  • 42
  • 401
  • 438
  • Only .txt .docand .xls files.IN My DB i am using longtext data type for 4 columns of different table.How abt using using DB again for uploasing(of size not more than 20MB).PLaese help me – user696225 Apr 11 '11 at 05:51