<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-firebase-quickdraw-multiplayer-iihhtnkbn" -->

---
title: Building Firebase Quickdraw Multiplayer | daily.dev
description: The Firebase team walks through how they added a multiplayer mode to their Quickdraw drawing game demo, covering the architecture built on Firebase Hosting,...
canonical: https://daily.dev/posts/building-firebase-quickdraw-multiplayer-iihhtnkbn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building Firebase Quickdraw Multiplayer | daily.dev
og:description: The Firebase team walks through how they added a multiplayer mode to their Quickdraw drawing game demo, covering the architecture built on Firebase Hosting,...
og:url: https://daily.dev/posts/building-firebase-quickdraw-multiplayer-iihhtnkbn
og:image: https://api.daily.dev/og/posts/iIhhTnKbN.png
og:image:alt: Building Firebase Quickdraw Multiplayer
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building Firebase Quickdraw Multiplayer

**[Firebase](https://daily.dev/sources/firebase-blog)** · 12 min read · 0 upvotes · 0 comments

## Summary

The Firebase team walks through how they added a multiplayer mode to their Quickdraw drawing game demo, covering the architecture built on Firebase Hosting, Realtime Database, Cloud Functions, and Firebase Performance Monitoring plus Google Analytics. Topics include designing a room-based database structure for up to four players, using transactions to avoid race conditions, handling disconnecting clients with the OnDisconnect feature, migrating legacy HTTP functions to callable functions, debugging with the Firebase Emulator Suite, and writing Security Rules that route room-joining logic through a Cloud Function to prevent unauthorized writes.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://firebase.blog/posts/2022/06/firebase-quickdraw>

## Questions this post answers

### How can I detect when a player disconnects from a Firebase Realtime Database multiplayer game?

Use the OnDisconnect feature of the Realtime Database client SDK, which lets you register operations that execute automatically when a client disconnects, cleanly or not. For example, calling onDisconnect(ref(db, path)).remove() removes a disconnected player from a game room in just a few lines of code, and the change syncs automatically to other connected clients.

_Building real-time multiplayer features on daily.dev-followed Firebase docs helps avoid reinventing disconnect handling._

### How do you secure a Firebase Realtime Database so only players in a game room can modify its data?

Combine Firebase Authentication with custom Security Rules that check whether the requesting user's auth.uid exists under the room's players list, and route the join logic through a Cloud Function since Cloud Functions can bypass security rules. This lets anonymous users create rooms while requiring a validated function call to actually join and gain write access.

_Developers hardening real-time apps can track Firebase security patterns like this via daily.dev._

### What is the difference between functions.https.onCall and functions.https.onRequest in Firebase Cloud Functions?

functions.https.onCall is a newer, cleaner interface compared to the legacy functions.https.onRequest, and it automatically handles CORS, serializes and deserializes request payloads, and authenticates user tokens for you. The legacy onRequest method still works but requires handling these concerns manually.

_daily.dev helps developers weighing Cloud Functions API choices stay current on Firebase tooling changes._

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#infrastructure](https://daily.dev/tags/infrastructure), [#firebase](https://daily.dev/tags/firebase), [#gcp-cloud-functions](https://daily.dev/tags/gcp-cloud-functions)

[View this post on daily.dev](https://daily.dev/posts/building-firebase-quickdraw-multiplayer-iihhtnkbn)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building Firebase Quickdraw Multiplayer","url":"https://daily.dev/posts/building-firebase-quickdraw-multiplayer-iihhtnkbn","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-firebase-quickdraw-multiplayer-iihhtnkbn"},"datePublished":"2026-08-23T12:20:33.053Z","dateModified":"2026-08-23T12:33:34.914Z","description":"The Firebase team walks through how they added a multiplayer mode to their Quickdraw drawing game demo, covering the architecture built on Firebase Hosting,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/db84dabe10ac6680bba20638c73ec73d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/db84dabe10ac6680bba20638c73ec73d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Firebase","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Firebase","logo":"https://media.daily.dev/image/upload/s--i395oqZH--/f_auto,q_auto/v1787487448/logos/firebase-blog?_a=BAMAMicg0","url":"https://daily.dev/sources/firebase-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/building-firebase-quickdraw-multiplayer-iihhtnkbn","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,infrastructure,firebase,gcp-cloud-functions","timeRequired":"PT12M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Firebase","item":"https://daily.dev/sources/firebase-blog"},{"@type":"ListItem","position":3,"name":"Building Firebase Quickdraw Multiplayer"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/building-firebase-quickdraw-multiplayer-iihhtnkbn#faq","mainEntity":[{"@type":"Question","name":"How can I detect when a player disconnects from a Firebase Realtime Database multiplayer game?","acceptedAnswer":{"@type":"Answer","text":"Use the OnDisconnect feature of the Realtime Database client SDK, which lets you register operations that execute automatically when a client disconnects, cleanly or not. For example, calling onDisconnect(ref(db, path)).remove() removes a disconnected player from a game room in just a few lines of code, and the change syncs automatically to other connected clients. Building real-time multiplayer features on daily.dev-followed Firebase docs helps avoid reinventing disconnect handling."}},{"@type":"Question","name":"How do you secure a Firebase Realtime Database so only players in a game room can modify its data?","acceptedAnswer":{"@type":"Answer","text":"Combine Firebase Authentication with custom Security Rules that check whether the requesting user's auth.uid exists under the room's players list, and route the join logic through a Cloud Function since Cloud Functions can bypass security rules. This lets anonymous users create rooms while requiring a validated function call to actually join and gain write access. Developers hardening real-time apps can track Firebase security patterns like this via daily.dev."}},{"@type":"Question","name":"What is the difference between functions.https.onCall and functions.https.onRequest in Firebase Cloud Functions?","acceptedAnswer":{"@type":"Answer","text":"functions.https.onCall is a newer, cleaner interface compared to the legacy functions.https.onRequest, and it automatically handles CORS, serializes and deserializes request payloads, and authenticates user tokens for you. The legacy onRequest method still works but requires handling these concerns manually. daily.dev helps developers weighing Cloud Functions API choices stay current on Firebase tooling changes."}}]}
```

