๐Ÿ“ก

Firebase Realtime Database

The Firebase Realtime Database is Google's original NoSQL cloud database, predating Firestore โ€” the entire dataset lives as one large JSON tree that syncs live to every connected client. It ties for around #14 in real-world database usage (roughly 5% share), still used where a simple, low-latency JSON sync is all an app needs.

๐Ÿ“Œ Quick facts
Type: Realtime JSON tree database (NoSQL)
Made by: Google Firebase
License: Proprietary, managed-cloud (free tier + pay-as-you-go)
Hosting: Fully managed
Primary use case: Simple realtime data sync for apps that don't need complex queries
Jump to: Example queryGetting startedBest for

Example query

Instead of collections and documents, everything is one big nested JSON object, referenced by path:

import { getDatabase, ref, set, onValue } from 'firebase/database'

const db = getDatabase();

// write data at a specific path in the JSON tree
set(ref(db, 'rooms/room1/messages/msg1'), {
  text: 'hey there',
  sender: 'ada'
});

// listen for live changes at that path
onValue(ref(db, 'rooms/room1/messages'), (snapshot) => {
  console.log(snapshot.val());
});

Getting started

Enable the Realtime Database from the Firebase console on a project, then connect with the Firebase SDK:

# install the Firebase SDK
npm install firebase

# then point initializeApp() at your project's databaseURL from the console
๐ŸŽฏ Best for
Simple apps that just need fast, live-syncing data โ€” presence indicators, live counters, basic chat โ€” where the data shape is simple enough that a flat JSON tree is easier than Firestore's document/query model.