I am just starting off with NoSQL structures, using Firebase in particular, which is hugely different then MySQL or rational DBs.
I am developing an app that will list sport games; the users can retrieve a list of all the games and select which one they would like to participate in.
The list of games spans, or at least will span multiple years, ex games in 2012, 2013, 2014, 2015, 2016 (present), 2017 (future) etc...
The table structure in my MySQL table has the following primary key combo (gameid, yearid, sportType); the reason being each new year instead of just incrementing the gameid, it would restart at 1 which needed the yearid to make it unique and the sportType since it could entries for baseball, football, hockey etc...
I am created the JSON structure and I guess I am questioning myself and need help to if you could just check if it is denormalized or if I can improve it somehow?
I think I am following rational methodology but I was thinking of have the following:
{
"games" : {
"year" : {
"sportType" : {
"desc" : "Week 1 ",
"teamid" : 123
"gameid" : 11111,
etc...
}
}
},
"year" : {
"sportType" : {
"desc" : "Week 1 ",
"teamid" : 223
"gameid" : 22222,
etc...
}
}
It kind of follows the primary indexing I did for MySQL but do I need to is the question!? I think I don't but I want other opinions since I am new to this...
I am thinking that I should just follow :
{
"games" : {
"gameid" : {
"desc" : "Week 1 ",
"teamid" : 123
"sportType" : "football",
"year" : 2016
etc...
Can someone please help guide me?!