I am new to firestore, I am.confused with the pricing/shallow structure. Would like to know the better way of querying a set of data I have.
I have the data structure as follow:
(a) collection [productList ]- main collection
(b) document [storeId ]- multiple documents in the range of 100's
(c) collection [itemList ]- sub collection
(d) document [Items ]- multiple documents in the range of 35 k to 45k
My query will be usually getting data from (d) collection using 'where' clause.
would it be better to remove the subcollections and have all it in the (b) documents and keep an extra ref parameter for querying. Keeping like it will increase the (b) document into 100k's of values.
does the pricing vary if I change to that data structure,which would be better for pricing and performance.
- does the pricing(read) depend on the whole set of 100k's or only on the 20 or 30 values returned after the where clause query.