I have a Firebase real-time database structured as such:
{
    product : {
        "book1" : {
            "name" : "LoTR",
            "category" : {
                "Fiction" : true
            }
        }
    }
    genre : {
        "Fiction" : {
            "name" : "Fiction",
            product : {
                "book1" : true
            }
        }
    }
}
I was wondering if I should also add a key-key table like:
genre_product : {
    -3i9wfiosdniov : {
        "book1" : "Fiction"
    }
}
To make relations and use the $key : true for integrity check?
Is one way of making relations better than the other or is it just by Use Case?
 
    