Skip to content
Advertisement

How does google firebase save users data so that every time the user logs on, the previous work they did on the website is still there? [closed]

How does google firebase save users data so that every time the user logs on, the previous work they did on the website is still there?

I watched a couple videos and saw that people use the Real-time data base in firebase, is that the solution? I’ve attempted using a tutorial but it didn’t go as planned.

Can someone please tell me how I can make it so that when a user logs onto my website (through a google login -> I’ve already set up google sign in authentication and firebase receives the users data) and they do something on it (I have a todo list and calendar on it) then when they refresh the page or close the browser window and re-log back on; what they wrote and did on my website is still there?

Also, I need to do it using html or javascript since my website was created using that (and CSS).

Linking a tutorial with your answer would be greatly appreciated, thank you in advance!

Advertisement

Answer

Firebase is a suite of tools, this suite contains a lite auth system built on Googles IAM service and can hold some limited and restricted data, display name, email, etc.

Firebase also has two main databases for text and information, Realtime and Firestore, both of which use different styles of structured data. Realtime is a giant JSON tree that you can add entries to any location and read without any restrictions other than bandwidth.

Firestore on the other hand is like Google Docs, each “document” can hold up to 1Mb of data in a similar JSON data while being inside a type of virtual folder called a collection.

Both have different ideals and restrictions making the use of both in a project more beneficial rather than choosing one or the other.

To break it down, Realtime has almost no write cost, making it ideal for updating data frequently but does better with intermittent reads due to the read costs scaling per kb. Firestore on the other hand has low priced reads and higher writes, ideal for data that doesn’t update frequently, this is also supported with a limited 1 second update time per document

There is another service called Firebase Storage which can hold data as well but may not suit everyone’s needs and has limited use, similar to Dropbox or google drive with a public download URL that is sharable.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement