Petr Jelínek
Petr Jelínek

Reputation: 1441

How does Google Firestore work in the background?

Recently, I started playing around with Google Cloud Firestore and I wonder, how does this thing work in the background. I read something about sockets, that they keep persist connection between client and server, instead of using classical HTTP requests.

Another feature is offline usage - when you make any change offline, content will be "cached" somewhere and when you go online, data are automatically send to the server.

And last thing is - I am using Angular for most of my projects and now, if I want some data from database, I don't have to make new subscription (sending new HTTP request). But, probably good thing is to keep only one open connection and when page is destroyed, I have to call unsubscribe to this object, right?

How do all these things work? Do you have any good resources or something?

Many thanks!

Upvotes: 1

Views: 365

Answers (1)

Happy-Monad
Happy-Monad

Reputation: 2002

There is a lot of information on the internet and Google and Firebase documentation that explains how these things work.

As you said offline usage allows to keep an application responsive in case of connectivity outage and maintains a cache of the changes until they can be resynchronized with the database, more information about offline data features here. Data retrieval can be done as standalone operation where you query current state of documents data or as a reactive continuous operation where you attach a listener to a document to get acquainted of the changes made to it. You can find more information about the first here and about the second here.

Finally, Firebase has a Youtube channel too with a ton of material that is worth checking.

Upvotes: 2

Related Questions