user696225
user696225

Reputation: 21

Uploading file using java

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.

Upvotes: 2

Views: 815

Answers (3)

Dead Programmer
Dead Programmer

Reputation: 12575

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

Upvotes: 3

Jigar Joshi
Jigar Joshi

Reputation: 240890

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

Upvotes: 1

asgs
asgs

Reputation: 3984

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

Upvotes: 1

Related Questions