I'm new in firebase, I know in mysql we have a table users
with a unique id (eg: 1, 2...).
If I have a table follow and I want to record who follows who, I add:
follow
1 3 // user_id 1 follows user_id 3
3 2
3 1
I'd like the best approuch in firebase real time database, I have a json users, with unique key too and username. And I have json follow:
follow:
CMypCAlwMXPeM8X07P0sKsO
|
--- randomkey
|
--- follow: UFPRK8GG4tMvCejEfqWiCE220Mv2
in other words, user CMypCAlwMXPeM8X07P0sKsO
follow user UFPRK8GG4tMvCejEfqWiCE220Mv2
.
In firebase, should I work with this unique users keys (like mysql) or should I use usernames? like:
josh
|
... randomkey
|
--- follow: marie
thanks!