title: Q: Firebase Extension Limit Child Nodes
body: <p>I am running a Firebase app with 160k DAU, an online turn based game which uses RTDB to send updates between players. My database load peaks at around 60% at the busiest hour.</p>
  <p>A long time problem for me has been how to &quot;clean up&quot; the match node after the game is over. Current structure:</p>
  <p><code>root/games/$gameId</code></p>
  <p>gameId is provided by the host in the matchmaking process. After that both players subscribe to this node and send updates.</p>
  <p>What I could do is to have one of the 2 clients delete the node after the game, but that would be another (unreliable) write to increase the database load. My main goal is to keep &quot;dead game nodes&quot; to a minimum and thus the storage cost (Blaze plan). I only recently found out about the extension, but I am curious what my &quot;cost&quot; would be.</p>
  <p>Q1: Would every trigger of this extension count as a &quot;write&quot; to my database? Seeing as only 1000 writes per second is allowed for one instance, this would further contribute to this count (it would trigger many times per second).</p>
  <p>Q2: In the youtube information video it says it &quot;works best&quot; with auto-generated IDs, but is it <em>needed</em>? <a href="https://www.youtube.com/watch?v=i_u_6RknUro" rel="nofollow noreferrer">https://www.youtube.com/watch?v=i_u_6RknUro</a></p>
  <p>I know that the extension is in fact just a cloud function but I would like to know how it works behind the scenes before I dare to use it :)</p>
  <p>Thankful for any help :)</p>