I am making a website with login and registration facility using firebase. I have used firebase "Authentication" database to store the registered users.However, "Authentication" database doesnt store anything other then emailid, password and an auto generated UUID.
I need to store more data like username, profile pic etc for a user. I would be using firebase's "real time" database for the same.
My question is what is the best practise to do the same. Should I use the UID as primary key from "authentication" database and keep it as foreign key in my real time database like below:
Authentication db:
Record 1 - Email:[email protected]; password:somepassword; UID:UID1 Record 2 - Email:[email protected]; password:somepassword; UID:UID2 RealTime db structure:
users | |--UID1 | |---Name:Amanda |---Surname:Waller |---age:30 |--UID2 | |---Name:MyName |---Surname:Mysurname |---age:39 Or is it better to use email id as primary key instead of using firebase's auto-generated UID. Because in sql we do not generally use the autogenerated ids as primary keys.