title: Firebase Database Batching
body: <p>I would like to know how smart is Firebase database, whether it batches together multiple database requests if I call them synchronously?</p>
  
  <p>For example, if below I make two identical requests, will it send to the backend only the last one, or both?</p>
  
  <pre><code>firebase.database().ref('test').set(1);
  firebase.database().ref('test').set(2);
  </code></pre>
  
  <p>Also, if I read synchronously multiple times the same location, will it send the request to the backend multiple times, or will it understand that the same location is read?</p>
  
  <pre><code>firebase.database().ref('test').once('value', snap =&gt; {});
  firebase.database().ref('test').once('value', snap =&gt; {});
  </code></pre>
  
  <p>Also, what is the overhead of listening for some path? In terms of memory and bandwidth. What is the maximum number of listeners per user I can use to not impact user's experience?</p>
  
  <pre><code>firebase.database().ref('...').on('value', snap =&gt; {});
  </code></pre>