FireMongo Bridge

Made by BKR Tools

Sync Firestore collections to MongoDB in real-time with comprehensive data transformation and management APIs.

<10
installs
Works with
Cloud Firestore
Version
1.0.7 | Source code
Tags
utilities, Database
License
Apache-2.0
Publisher
BKR Tools
Report
Bug
Abuse

How this extension works

FireMongo Bridge Extension - Pre-Installation Guide

πŸ’° Pricing Information

This extension uses Firebase’s pay-per-use pricing model with no fixed monthly cost.

What’s Included

  • Real-time Firestore to MongoDB synchronization
  • Batch processing for existing documents
  • Data transformation for Firestore-specific types
  • Management APIs for monitoring and control
  • Automatic index creation
  • Comprehensive error handling and logging
  • Connection pooling and performance optimization

Costs

  • Cloud Functions: Pay per invocation (~$0.40/million invocations)
  • Firestore: Standard read/write costs (~$0.06/100K reads, ~$0.18/100K writes)
  • MongoDB: Your MongoDB provider costs (Atlas, self-hosted, etc.)

Cost Estimation Example

For a typical application with:

  • 10,000 documents
  • 1,000 daily updates
  • 100 daily reads

Monthly Cost Breakdown:

  • Cloud Functions: ~$0.12
  • Firestore Operations: ~$0.05
  • Total: ~$0.17/month

Visit Firebase Pricing for detailed pricing information.

πŸ“‹ Prerequisites

Required Setup

  1. Firebase Project: Must have billing enabled
  2. MongoDB Database: Atlas cluster or self-hosted MongoDB
  3. Firebase CLI: For local development and testing
  4. Node.js 20+: For development environment

MongoDB Requirements

  • MongoDB 4.4+ (recommended: 6.0+)
  • Network access from Google Cloud Functions
  • User with read/write permissions
  • Sufficient storage for your data

Firebase Requirements

  • Blaze (pay-as-you-go) billing plan
  • Firestore database enabled
  • Cloud Functions API enabled
  • Appropriate IAM permissions

πŸ”§ What You Need Before Installing

1. MongoDB Connection String

mongodb+srv://username:password@cluster.mongodb.net/database
  • Username and password for MongoDB access
  • Cluster hostname and port
  • Database name
  • Connection options (if needed)

2. Collection Planning

Decide on your collection mapping strategy:

{
  "users": "firestore_users",
  "products": "firestore_products",
  "orders": "firestore_orders"
}

3. Sync Strategy

Choose your synchronization mode:

  • Real-time: Immediate sync for all changes
  • Batch: Manual sync only (for compliance or cost control)

4. Performance Considerations

  • Document Size: Large documents may require smaller batch sizes
  • Collection Count: More collections = more function invocations
  • Update Frequency: High-frequency updates increase costs
  • Data Volume: Consider MongoDB storage and performance

πŸš€ Common Use Cases

1. Analytics and Reporting

  • Sync Firestore data to MongoDB for complex analytics
  • Use MongoDB aggregation pipelines
  • Integrate with BI tools

2. Backup and Compliance

  • Create MongoDB backups of Firestore data
  • Meet regulatory requirements
  • Disaster recovery planning

3. Multi-Database Architecture

  • Use Firestore for real-time features
  • Use MongoDB for complex queries
  • Hybrid application architecture

4. Data Migration

  • Migrate from Firestore to MongoDB
  • Gradual transition strategy
  • A/B testing with both databases

πŸ”’ Security Considerations

MongoDB Security

  • Use MongoDB Atlas for managed security
  • Enable network access lists
  • Use strong authentication
  • Consider encryption at rest

Firebase Security

  • MongoDB credentials stored as secrets
  • No sensitive data in logs
  • CORS configured for management APIs
  • Input validation on all parameters

Network Security

  • MongoDB must be accessible from Google Cloud
  • Consider VPC peering for private networks
  • Use SSL/TLS for all connections

πŸ“Š Performance Guidelines

  • Batch Size: 100-500 documents (adjust based on document size)
  • Memory: 512MB for real-time sync, 1GB for batch processing
  • Timeout: 540 seconds for large collections
  • Concurrency: 1000 for real-time sync

Optimization Tips

  1. Indexes: Enable for better query performance
  2. Collection Mapping: Use to organize data efficiently
  3. Batch Processing: Use for large initial syncs
  4. Monitoring: Watch function logs for performance issues

🚨 Important Notes

Data Consistency

  • Real-time sync provides eventual consistency
  • Small delays possible during high load
  • Use management API to verify sync status

Error Handling

  • Failed operations are logged with details
  • Automatic retry for transient errors
  • Manual recovery options available

Monitoring

  • Function logs available in Firebase Console
  • Sync status API for monitoring
  • Performance metrics in Cloud Functions

Limitations

  • Maximum document size: 1MB (MongoDB limit)
  • Maximum batch size: 1000 documents
  • Function timeout: 540 seconds
  • Memory limit: 1GB per function

πŸ†˜ Getting Help

Before Installation

After Installation

  • Use management API to verify setup
  • Check function logs for any issues
  • Monitor sync status regularly

Support Resources

βœ… Installation Checklist

Before proceeding with installation, ensure you have:

  • Firebase project with billing enabled
  • MongoDB database accessible from Google Cloud
  • MongoDB connection string ready
  • Collection mapping strategy planned
  • Sync mode decided (real-time vs batch)
  • Performance requirements understood
  • Security measures in place
  • Monitoring strategy planned

🎯 Next Steps

After installation:

  1. Configure extension parameters
  2. Test MongoDB connectivity
  3. Run initial sync for existing data
  4. Verify sync status
  5. Monitor performance and costs
  6. Set up alerts and monitoring

Ready to install? Proceed to the installation step and configure your extension parameters.