Features

MSR Firebase brings database migrations to Firebase Realtime Database. It combines Firebase-specific integration with the migration workflow and extension points provided by MSR Core.

Table of contents

  1. Firebase at a glance
  2. Features by category
    1. Firebase integration and configuration
    2. Migration workflow
    3. Locking, backup, and recovery
    4. CLI and library API
    5. Data services and transactions
    6. Developer experience and testing
  3. Choose by use case
  4. Get started
  5. Release history and upgrades

Firebase at a glance

πŸ”₯ Built for Firebase RTDB

Connect through Firebase Admin, use path shifting for environments, and test against the Firebase Emulator. Transactions are atomic at a single database node.

πŸ›‘οΈ Manage migration risk

Validate migrations, detect checksum changes, choose backup behavior, and enable database-level locking for concurrent migration runs.

βš™οΈ Use the CLI or API

Run migrations with msr-firebase or integrate them into a Node.js application with FirebaseRunner and structured results.

πŸ“˜ Work with TypeScript

Write typed migration classes, use Firebase-specific data services, and run local integration checks with the Firebase Emulator.


Features by category

The tables group MSR Firebase capabilities by the work they support. Feature names link to the relevant guide, configuration page, or API reference.

Firebase integration and configuration

Feature What it provides
πŸ”₯ Realtime Database support Connect migrations to Firebase Realtime Database through the Firebase Admin SDK.
πŸ”‘ Firebase authentication Authenticate with a service-account JSON key file.
🌐 Path shifting Keep environment data under a configured path prefix in a shared database.
πŸ§ͺ Firebase Emulator support Run migration tests against a local Realtime Database Emulator.
πŸ”Œ Connection diagnostics Inspect Firebase connection information and test connectivity with Firebase-specific CLI commands.
βš™οΈ Environment and file configuration Configure Firebase credentials and database settings with environment variables, config files, or CLI flags.

Migration workflow

Feature What it provides
πŸ“ TypeScript and JavaScript migrations Define migrations as versioned classes with typed database access.
πŸ”„ Up and down migrations Apply changes with up() and define rollback behavior with down().
πŸ“¦ Batch execution Apply pending migrations with the CLI or programmatic runner.
🎯 Targeted execution Run migrations to a selected version or choose a target through the runner API.
πŸ“Š Migration status Inspect applied and pending migrations.
βœ… Validation and checksums Validate migrations before execution and detect changes to migration files through Core validation.

Locking, backup, and recovery

Feature What it provides
πŸ”’ Database-level migration locking Coordinate migration runs through a lock stored in Firebase Realtime Database when locking is enabled.
⏱️ Lock expiration and ownership checks Configure lock timeouts and verify lock ownership during release.
πŸ–₯️ Lock management commands Inspect a lock and release a stale lock through the CLI.
πŸ’Ύ Automatic backups Use Core-managed backups during migration execution according to the configured backup mode.
🎚️ Backup modes Choose full, create_only, restore_only, or manual behavior.
🎯 Selective backup paths Back up selected database paths or leave the setting empty for a full-database backup.
πŸ”™ Restore and rollback Restore a saved backup through the API or CLI and choose a rollback approach for migrations.
☸️ Container deployment examples Review Kubernetes and Docker Compose examples for migration locking.

CLI and library API

Feature What it provides
πŸ–₯️ Migration CLI Run migration, list, down, validate, backup, restore, and lock-management commands.
πŸ”₯ Firebase-specific CLI commands Inspect Firebase information, test the connection, work with nodes, and back up selected nodes.
🚩 CLI configuration options Set the database URL, credentials, backup behavior, and standard MSR options.
πŸ“Š Table and JSON output Display migration status for people in tables or consume grouped migration records in scripts as JSON.
🧩 FirebaseRunner Create a configured Firebase runner and call migration operations from application code.
βš™οΈ FirebaseConfig Configure Firebase-specific settings alongside supported Core options.
πŸ“‹ Structured results Handle migration outcomes in application code without terminating the host process with process.exit().

Data services and transactions

Feature What it provides
πŸ“¦ EntityService Perform typed CRUD operations for collections of Firebase entities.
πŸ”„ Batch entity updates Transform multiple entities with updateAll().
πŸ—ƒοΈ FirebaseDataService Use lower-level Firebase database operations provided by the adapter.
πŸ” Single-node transactions Perform atomic read-modify-write operations at one Realtime Database node; Firebase does not provide database-wide transactions.

Developer experience and testing

Capability What it means
πŸ“˜ TypeScript-first API Use typed migration contracts and Firebase database types in application code.
πŸ§ͺ Emulator-based integration tests Exercise migrations against a local Firebase Realtime Database Emulator.
πŸ“š Guides and API reference Find setup, migration, CLI, library, configuration, and API documentation from the site navigation.
🧰 MSR Core foundation Use the shared migration engine and adapter contracts provided by MSR Core.

Choose by use case

If you need to… Start with…
Set up Firebase credentials and run your first migration Getting Started
Test migration behavior before deployment Firebase Emulator testing and migration validation
Separate development, staging, and production data Path shifting and configuration
Coordinate migration runs in multiple processes Migration locking
Choose a backup and rollback approach Backup and restore and backup configuration
Run migrations from an application Library usage and FirebaseRunner
Work with typed Firebase entities EntityService

Get started

  • Getting Started β€” Install MSR Firebase and run your first migration.
  • CLI Usage β€” Configure and use the msr-firebase command.
  • Library Usage β€” Run migrations from a Node.js application.
  • Writing Migrations β€” Build, validate, and test migration scripts.
  • API Reference β€” Explore Firebase-specific classes, interfaces, and types.
  • MSR Ecosystem β€” See the projects in the Migration Script Runner family.

Release history and upgrades