Referencing authentication db data in real time db firebase -


i making website login , registration facility using firebase. have used firebase "authentication" database store registered users.however, "authentication" database doesnt store other emailid, password , auto generated uuid.

i need store more data username, profile pic etc user. using firebase's "real time" database same.

my question best practise same. should use uid primary key "authentication" database , keep foreign key in real time database below:

authentication db:

record 1 - email:abc@test.com; password:somepassword; uid:uid1 record 2 - email:abcd@test.com; password:somepassword; uid:uid2 

realtime db structure:

users | |--uid1    |    |---name:amanda    |---surname:waller    |---age:30 |--uid2    |    |---name:myname    |---surname:mysurname    |---age:39 

or better use email id primary key instead of using firebase's auto-generated uid. because in sql not use autogenerated ids primary keys.

it’s better use uid. 1 thing, can’t have periods in keys, if use email key you’ll have handle replacing them other character. also, forms of authentication don’t require email, twitter. since can uid once user authenticated, that’s i’d recommend.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -