views:

42

answers:

2

Hello there.

Right now I'm facing some performance issues in a web app because of a situation with Oracle saving images and my webapp getting them.

The database gets the input from a form, which allows user to save any kind of image as a BLOB. No matter the format, it gets saved in a table with its description and stuff. The field getting the image is a BLOB.

Then, through a web service querying the table (using a stored proc.) and a Java WS client, my webapp gets the image and saves it in the webapp's server while needed. It does not get any particular extension because the DB doesn't tell which extension should it be. Anyhow, the broswer can tell using the metadata.

My problem is: how can I avoid the DB serving a bitmap? The performance is awful in specific situations and poor connections because of loading a 1.5MB bitmap. And this webapp must be able to work properly in 256Mb conns. What can be done, then?

Thanks for your help.

Edit: The thing can be treated using BFILE datatype. Thanks for your help.

A: 

You should convert the image to a jpeg in memory, using a decent compression ratio, and serve that instead. Also, you may want to scale it so that it's a certain (smaller) resolution, or perhaps use a thumbnail. Then have a link to download the full resolution image, if they must.

We serve up photos in an application, which must load quickly, and we convert the images on the fly on the server before we send them. We have it in mind that if it ever becomes a bottleneck, we will store the converted file also so that it doesn't require processing each time.

Also, you could use gzip compression when loading the bitmap, if your client supports it. Jpeg can still be much smaller than compressing the original with gzip because you can scale it down and Jpeg is lossy--it lets you trade off quality for file size.

Marcus Adams
A: 

Not sure at which layer you actually want to handle things. If it is the database layer, then I suspect you need to start using ORDSYS.OrdImage datatypes, and you can them make use of the built-in format conversion operations to turn BMP to JPG or whatever.

Also consider is the problem with large bitmaps or with large image files in general.

Gary