I want to ask a question about Firebase , namely, storing data in a Firebase database. As far as I understand it: that as soon as the data is saved in the Firebase database, they are immediately sent to the server and Firebase updates the data on all devices that have this application installed. What happens when a user is offline, all data is lost? and the user can no longer use the application? How are conflicts resolved? For example, a user on one device deleted some data while being offline, and another user made a change to this data.

    1 answer 1

    As soon as the data in FireBase is updated (and if you used ValueEventListener), then the user who is currently running in the application will be updated and he will see it. When the user is offline, all data is stored in Firebase (only the user does not know about it). The user can still use the application even offline, as stated in the documentation . If someone has made changes to the database, then the changes will occur immediately, and whoever connects from offline, that is, becomes online, finds the desired branch and already deletes this data. So other users will not see the branch with this data from the database. P.S. What do you have for the data that the user can delete them, and the other can change them? Maybe it's better to make them personal - who wanted to delete, change. And make the basic data read-only for the majority.