Display image on form...

A

Amit Jain

Hi All,

I want to display user image on one form (like user profile page). I
have to option as metion below:
1. Store image with its relative path in table column.
2. Store image in DB itself using blob as column data type.

But each method hs its own drawback
In first solution when we are using relative path it use OS level
search using relative path which is a native call.
In second method DB size will grow like any thing.

I am confuse and not able to decide which approch will be good. I
request you all to suggest me I should go with which approach also
suggest if there is other way as well.

Thanks and regards, amit J.
 
S

Sherkan

Hi All,

I want to display user image on one form (like user profile page). I
Hi,
It all depends what do you need.
If you store pictures in db, db will grow mostly if you use psd, bmp
pictures.
It takes system resources mostly for transaction, db connector.

Maybe if you upload pictures maybe try to resize, change them all to
for an example jpg and compress before store in db.

Another help:
If you use apache front end server, maybe better will be to store
pictures in the some directory /my_pictures/*
Apache has good native caching and is much better to load pictures
instead of tomcat/jboss.

it all depends what do you need. In some cases much better is to store
pictures in db, and in some in the hard drive directory.
 
A

Amit Jain

Could you please explain in what are those case in which its better to
store
pictures in db, and in what case in the hard drive directory.
 
S

Sherkan

Could you please explain in what are those case in which its better to
store
pictures in db, and in what case in the hard drive directory.

First:
1. How much servers do you have for production?
2. What servers, what technology, db?
3. How much users do you have?
4. Is there lot of graphic like graphic forum or graphic gallery where
you server mostly graphic or you have mostly text/html page and you
got only few pictures to serve?
 
L

Lew

It all depends what do you need.
If you store pictures in db, db will grow mostly if you use psd, bmp
pictures.
It takes system resources mostly for transaction, db connector.

The definition of "the db will grow" is a question, here. Databases store
binary data in a BLOB column, which is stored as a separate file from the data
rows in every BLOB implementation I've heard of. The actual database data
file(s) remain(s) relatively compact.

As to whether to store in db or file system, that's an "it depends" all right.
The database helps control management of the media files, but file storage
is inherently more natural.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top