You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, each member's record is stored in an individual document within the Firestore collection. While this structure allows for easy querying of individual records, it leads to a significant spike in the number of reads. This is especially problematic when performing operations that require fetching data for all members, as it results in a separate read for each document.
The same issue exists for other collections where individual records are stored as separate documents.
Proposed Solution
To optimize Firestore's read costs and improve efficiency, we propose restructuring the data:
Store all member records as an array within a single document.
Apply this restructuring to other collections with similar issues.
Implement pagination and partial document fetching (using Firestore's array-contains or similar features) to prevent fetching unnecessarily large data.
This approach will drastically reduce the number of reads, especially for bulk operations, while maintaining a manageable structure for the data.
The text was updated successfully, but these errors were encountered:
Currently, each member's record is stored in an individual document within the Firestore collection. While this structure allows for easy querying of individual records, it leads to a significant spike in the number of reads. This is especially problematic when performing operations that require fetching data for all members, as it results in a separate read for each document.
The same issue exists for other collections where individual records are stored as separate documents.
Proposed Solution
To optimize Firestore's read costs and improve efficiency, we propose restructuring the data:
array-contains
or similar features) to prevent fetching unnecessarily large data.This approach will drastically reduce the number of reads, especially for bulk operations, while maintaining a manageable structure for the data.
The text was updated successfully, but these errors were encountered: