mysql - Database design for user medias -
i creating site users can upload images , videos on facebook. have 2 ideas , wonder better: 1)
usermedias{userid, mediaid...} medias{mediaid,mediatypeid,name,url...} mediatypes{mediatypeid,name...} 2)
userimages{userid, imageid...} image{imageid,name...} uservideos{userid,videoid...} videos{videoid,name...}
first implementation has following pros:
- as khez said, allow faster join
- it not require change schema if want include audio later on.
both video , photo have same attributes other fact physically different.
Comments
Post a Comment