Overcome Firestore’s Limitations by Migrating to MongoDB
Presenting a breakdown of the NoSQL cloud database Firestore: its limitations and our expertise in migration from Firestore to MongoDB.February 17, 2023 | Migration | Feature Highlight

Cloud Firestore is a flexible, NoSQL database for mobile, web, and server development. Amidst all its glory, Firestore has some notable shortcomings.
For starters, Firestore has a limit of one instance per project, several query limitations, and provides no straightforward way of cleaning up data spread over multiple collections.
This article highlights certain shortcomings of Firestore and our expert take on migrating from Firestore to MongoDB.
Dissecting the Pitfalls of Firestore
Firestore uses the NoSQL data model to store and sync data for client-and-server-side development. It syncs data in documents across client apps through real-time updates. The documents support many different data types and are further organized into collections. You can also create subcollections within documents and build hierarchical data structures.
While Firestore provides no-maintenance massive scalability, there are some significant pitfalls:
Problems with aggregation queries
An aggregation query processes data from multiple index entries to return a single summary value. Firestore supports the count() aggregation query that allows you to determine the number of documents in a collection or query. These queries rely on the existing index configuration and scale proportionally to the scanned index entries. This translates to a read of each matching row of the query and hinders efficient scaling.
Tricky latency and slow write frequency
Firestone’s limits on writes and transactions can significantly hamper scaling under load. The maximum sustained write rate to a document is 1 per second, which is quite long as per the industry standard. While this latency may be feasible during the inception, it can progressively burden as writes begin to fail at higher sustained rates.
Full-text search
Firestore doesn’t support native indexing or search for text fields in documents. Consequently, you need to rely on extensions to perform a full-text search (like searching for posts that contain a specific string).
The Cloud Firestore documentation suggests using Algolia - a dedicated third-party search service. However, this alternative creates the problem of syncing data across two databases, making it challenging to maintain document integrity.
Data Integrity and Security
Firestore doesn’t guarantee data integrity because it has very dynamic data structures similar to JSON. Therefore, developers cannot constrain data on the database level or set restrictions such as "only certain fields can be viewed" within a single data collection. As a result, bugs are inevitable and can lead to a data compromise.