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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -