i'm in planing phase of development of mobile app , need decide wheather should go mysql or mongodb. first let me describe data:
i have set of items (e.g. movies) users able browse , score in different ways. total number of items approximately 20 000 , not grow or shrink.
each user able score each item (numerical value) , write comment assigned each item. expect average user score maybe 40 different items, hopes higher!
the typcial queries be
give me items satisfies criteria , let me browse them. example: give me thrillers produced in europe during 00s.
give me movies particular user has scored.
i server side calculations e.g. average score each movie, , each time user sumbits new score item average should updated.
for mysql have database 3 different tables (items, users, scores) , mongodb i'm considering database 1 collection, this:
{ "name":"inception" "year":2010 "director":"christopher nolan" "scores" : [ { "user_id": 1234 "scorea" : 3, "scoreb" : 5, "scorec" : 4, }, { "user_id": 1235 "scorea" : 4, "scoreb" : 3 }, } { "name":"titanic" "year":1997 "director":"james cameron" "scores" : [ { "user_id": 1201 "scoreb" : 5, "scorec" : 5 }, { "user_id": 1220 "scorea" : 4, "scorec" : 5 }, } ... question: given use case, matter if use mysql or mongodb?
thank in advance!
go relational database mysql, there no need use mongodb here unless wanna try out.
as generell advice use nosql (especially mongodb) when can't improve rdms anymore.
also take @ wonderful presentation: http://www.thedotpost.com/2015/06/neha-narula-consistency-and-candy-crush
Comments
Post a Comment