aspose file tools*
The moose likes General Computing and the fly likes storing image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "storing image" Watch "storing image" New topic

storing image

Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455


any ideas on how images are stored in social websites like facebook/myspace. Its not stored in filesystem i believe. What would be the best approach to store images if have to develop a website like facebook application using j2ee .

i have stored images in db and displayed in on JSP using servlets for my current project . Is it a good approach if there are millions of users uploading images ?
I'm just curious :-)


SCJP, SCWCD, SCBCD, Oracle Certified Professional (SQL n PL/SQL)
Jeremy Wilson
Ranch Hand

Joined: Feb 18, 2003
Posts: 166
Anytime I have stored images for use for applications of mine I have stored them as blobs in an oracle database. That way you can use additional attributes in the table for indexing.

Jeremy Wilson
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
i agree with that DB approach but if there are millions of images, is it the right way to do it ? i was wondering if there is anything much better which im not ever aware of.

Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

face book uses a system called Haystack.
read Inside Facebook’s Photo Factory
or this from facebook

"One of the best things you could do is to simplify a larger application into a smaller one by reducing its process and complexity - Fowler"
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42641
I've only ever used file system storage, meaning the relevant DB record contains all the information needed to access the image file on a file server.

You'd need to think about how to handle synchronization in the case where more than one person has write access to an image (not likely in the Facebook example, but often the case in image-handling applications).

Ping & DNS - my free Android networking tools app
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

we use a netApp server to store images and access them using HTTP to display on the screen.
The paths are stored in a DB
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
This has nothing to do with PD. Moving to General Computing

Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
thank you all for the replies !! its really informative..
no, there is no need for synchronization, no 2 people will be editing an image at same time. I was just curious to know about the image storing approach used by various websites which has millions of unique daily users.

Aniruddh, thanks for the facebook link.

- raj
Vinod Tiwari
Ranch Hand

Joined: Feb 06, 2008
Posts: 466

You can use content server, set workflow, etc....

Vinod Tiwari | Twitter | Shikshanirman | Guftgu
James Ward
Ranch Hand

Joined: Apr 27, 2003
Posts: 263
You could store your images in a third-party storage like Amazon S3.

The advantage here is that the storage is quite cheap, and your main web-site is not hit with image requests, instead it goes to a third-party.

Infact a lot of social networking sites, like many have pointed out do store images separately.
The largest number of images is with facebook!
pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 413

Check this one Facebook approach

Pawan Chopra
I agree. Here's the link:
subject: storing image