Samantha Withanage
Samantha Withanage

Reputation: 3851

store image in database vs file system

in my java application I'm maintaining a users database and I have to store user account picture together with other details. i can store the photo in my database or I can store the image in my file system and store relevant path in the database. which one is more suitable in terms of memory and running time ?

Upvotes: 3

Views: 2726

Answers (3)

Anvesh
Anvesh

Reputation: 7683

Reference taken from this article:

You should take decision based on your system complexity and scalability. I suggest you to go with File System and Database Storage is not allowable, but still it is advisable. Management is always easy with database storage, but will create a performance issue in some circumstances. Management is quite complex with file system, but you will get more performance.

Upvotes: 1

omriman12
omriman12

Reputation: 1690

File system is obviously faster if you have the option.

You can use varbinary if you have to insert it to your db.

Upvotes: 1

IceManSpy
IceManSpy

Reputation: 1098

You should store file on file system. You can read about this on programmers stackexchange: https://softwareengineering.stackexchange.com/a/150787

Upvotes: 1

Related Questions