• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Saving image on server in directory structure vs in database

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am working on an java web application where user can have number of images like in facebook or orkut, now i have two ways to implement it
1) keep images in directory structure on server
2) keep images in database for every user.

can you guys suggest me the best way to implement it either from above mentioned ways or any other way according to you............

thanks
Amar

 
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to Javaranch !!!

i would suggest -- keep images iin a directory on server.

Reasons

a. images (facebook / orkut image) are static
b. Images are not tied to any user (means every user will see same image of facebook / orkut etc)
c. easier to change images in a directory if required
d. saving image for each user in databse using BLOB/CLOB type is not a good idea

~ abhay
 
amar gupta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Abhay Agarwal wrote:Welcome to Javaranch !!!

i would suggest -- keep images iin a directory on server.

Reasons

a. images (facebook / orkut image) are static
b. Images are not tied to any user (means every user will see same image of facebook / orkut etc)
c. easier to change images in a directory if required
d. saving image for each user in databse using BLOB/CLOB type is not a good idea

~ abhay



thanks Abhay for your prompt reply .......

let's suppose i am creating a directory under context folder, now when user will increase day by day, a lot of spaces occupies on server by this directory. will it effect on server any way? i really have no idea about it.

thanks
Amar
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please specify what will the contents in that directory under 'context' folder.
content will be static images ??

~ abhay
 
amar gupta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, content will be static image but i am talking about a scenario when application has thousand of user and each user save at least 50 static image for example there is a image folder on server that have thousand of user folder like user1 , user2........... and in each folder there is around 50 static image. i think in such case the size of image folder will become in GB so do you think it will matter in any way?? or create some problem ?
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amar,
When you mean images, is it the images that your web site uses?, or is it like the photo uploads of users in facebook/orkut?
 
amar gupta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Krishnegowda

yes it is like the photo uploads of users in facebook/orkut

thanks
Amardeep
 
reply
    Bookmark Topic Watch Topic
  • New Topic