MySQL Database - Table to share contents between users -


i wanted know 1 think it's best solution situation.

i've got application in items can shared. these items, however, can of different types: photos, posts, "groups of posts", , on, there's table called 'posts', called 'media', etc.

the users will able see items shared them , created. so, think it's better?:

  • make table called 'shared_items' in i'd put item_id, user_id, item_type.

  • make table each type of item (for example: shared_posts, shared_media, etc.), same structure above explained (but without item_type).

more solutions accepted, of course, these ones coming mind right now.

if need database structure sample tell, think it's not necessary.

thanks time!

it depends on how going query data , how often. if need of shared items in 1 query, single table preferable. rid table joins. database normalization keep flies separately, soup separately , go shared media, shared posts, shared tables.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -