I am currently working on a database layout for my Firebase database. I look at a lot of different guides about how layouts should look, but I'm a little confused about the correctness.
I'm not sure if users should be saved, let me give an example:
{
"users": {
"alanisawesome": {
"nickname": "Alan The Machine"
},
"gracehop": {
"nickname": "Amazing Grace"
}
}
}
In the above example, from Firebase Legacy documents, they store users by their usernames. However, in another example, I found the following:
{
"users": {
"123": {
"name": "Kato"
},
"234": {
"name": "Anant"
}
}
}
Here they store users with a UID. Then you can just just push()new users, and their identifiers are random keys, such as -JRHTHaKuITFIhnj02kE.
? , UID ?