Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.


+12 votes

We are using firebase to host user info as well as reviews that the post to our app. When generating a ID key for each of these users is it best to allow firebase to auto-generate them as the are guaranteed to be different or generate a key manually based off the email they sign up with?

asked in CSC490_Spring202021 by (8 points)

I am adding the firebase ID autogeneration tool to create unique ideas on a project I am working on and it is working out fine, try it and let me know if you encounter a problem, I can help out!

3 Answers

+5 votes

You can use https://www.npmjs.com/package/react-uuid to do local generation keys that are also granted to be unique if you don't want to use firebase generated keys. Both way your guaranteed unique keys.

answered by (8 points)
+4 votes

I think in a situation like the email they are signing up with in our app where the first part is guaranteed to be unique, making your own is fine. Otherwise, I think the automatic key generation works well for IDs for objects with properties that are hard to make into a unique key.

answered by (8 points)
+3 votes

Yes, everyone new signs up with firebase gonna be unique ID

answered by (8 points)