Database design for sharing photos site?
- by javaLearner.java
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:
Whats the best database design for photo-sharing website (like flickr)?
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
What size of photos should I keep? Currently I only stored thumbnail (100x100) and (max) 1600x1200 px photos.
What others things I should take note when developing photos-sharing website?