I have the following exemplary data structure:
"peopleOfFame": {
"asd456789": {
"firstName": "John",
"lastName": "Wayne",
"dateOfBirth": "19660702"
"marriedTo": "yxc321lkj"
},
"yxc321lkj": {
"firstName": "Jennifer",
"lastName": "Aniston",
"dateOfBirth": "19620228"
"marriedTo": "asd456789"
}
},
"relationshipsAmongstPeopleOfFame": {
"asd456789yxc321lkj": {
"asd456789": true,
"yxc321lkj": true,
"datingSince": "20170729",
"children": "0",
"happy": true
},
"yxc321lkj": {
"asd456789asd456789": true,
"yxc321lkj": true,
"datingSince": "20170729",
"children": "0",
"happy": true
}
}
Is there any downside to using the combined ids of the peopleOfFame
as the id
for the objects in relationshipsAmongstPeopleOfFame
?
I feel like this is a good use case where our life would be easier and queries would be faster doing it this way. I've read a ton about data structures in Firebase
and I have not come across those examples yet. Neither in a way that encourage them nor discourage them.
Obviously, we have limited use when the number of potential ids
grows. But I am talking about clear cut cases where two stored objects form another single stored object.
So, in summary, my question would be: Can you provide me with counter arguments as to why this approach is not good? Or can you encourage me and show me further use cases for this? I feel like there is not a lot out there with those specific 2 objects => 1 object
examples.