Database design for sharing photos site?

Posted by javaLearner.java on Stack Overflow See other posts from Stack Overflow or by javaLearner.java
Published on 2010-05-19T03:04:41Z Indexed on 2010/05/19 3:10 UTC
Read the original article Hit count: 383

Filed under:
|
|
|
|

I am using php and mysql. If I want to do a sharing photos website, whats the best database design for upload and display photos. This is what I have in mind:

domain:
  |_> photos
  |_> user

Logged in user will upload photo in [http://www.domain.com/user/upload.php]

The photos are stored in filesystems, and the path-to-photos stored in database. So, in my photos folder would be like: photos/userA/subfolders+photos, photos/userB/subfolders+photos, photos/userC/subfolders+photos etc

Public/others people may view his photo in: [http://www.domain.com/photos/user/?photoid=123]

where 123 is the photoid, from there, I will query from database to fetch the path and display the image.

My questions:

  1. Whats the best database design for photo-sharing website (like flickr)?

  2. Will there be any problems if I keep creating new folder in "photos" folder. What if hundreds of thousands users registered? Whats the best practices

  3. What size of photos should I keep? Currently I only stored thumbnail (100x100) and (max) 1600x1200 px photos.

  4. What others things I should take note when developing photos-sharing website?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql