Every client connected to a Firebase database maintains its own internal version of any active data.When data is written, it's written to this local version first.If there is no data, the snapshot returned is method is called every time data is changed at the specified database reference, including changes to children.To limit the size of your snapshots, attach only at the highest level needed for watching changes.Simultaneous updates made this way are atomic: either all updates succeed or all updates fail.The simplest way to delete data is to call method on your Firebase database reference.
You give this operation two arguments: an update function and an optional completion callback.This repeats until the transaction is accepted or too many attempts have been made.If a client loses its network connection, your app will continue functioning correctly.If data is stored in multiple locations to scale better, you can update all instances of that data using data fan-out.For example, a social blogging app might have a , such as how this example creates the new post in both locations.