Firebase Functions V2 Migration

Firebase Functions V2 Migration

Migrated 200+ Cloud Functions from Firebase V1 to V2, modernizing the serverless backend while maintaining zero downtime for 100K+ daily users.

Technologies Used

Firebase Cloud Functions TypeScript GCP Terraform

Key Features

200+ functions migrated
Zero downtime migration
100K+ daily active users unaffected
Improved cold start performance
Modern concurrency controls

Project Overview

Led the migration of 200+ Firebase Cloud Functions from V1 to V2, modernizing the entire serverless backend for a production platform serving 100K+ daily active users.

The Challenge

Firebase announced V1 function deprecation timelines. With 200+ functions powering everything from authentication to payment processing, the migration couldn’t be rushed—but it also couldn’t wait. The platform serves 100K+ daily users who expect zero interruption.

What I Did

Designed and executed a phased migration strategy:

  • Dependency Mapping: Cataloged all 200+ functions, their triggers, dependencies, and traffic patterns to determine migration order
  • V2 Architecture: Redesigned functions to take advantage of V2 features: concurrency controls, longer timeouts, and Cloud Run integration
  • Incremental Rollout: Migrated functions in batches by domain (auth, payments, notifications), with automated rollback capability at each phase
  • Testing: Built an integration test suite that validated function behavior pre- and post-migration, catching regressions before they reached production

Outcome

All 200+ functions migrated to V2 with zero downtime. Cold start performance improved noticeably across the board. The new concurrency controls reduced function instance counts, lowering costs. The migration was completed ahead of Firebase’s deprecation timeline.

Completed on: Nov 1, 2024