I am attempting to figure out a solid strategy for handling schema changes in Firestore. My thinking is that schema changes would often require reading and then writing to every document in a collection (or possibly documents in a different collection).
Here are my concerns:
- I don't know how large the collection will be in the future. Will I hit any limitations on how many documents can be read in a single query?
- My current plan is to run the schema change script from Cloud Build. Is it possible this will timeout?
- What is the most efficient way to do the actual update? (e.g. read document, write update to document, repeat...)
- Should I be using batched writes?
Also, feel free to tell me if you think this is the complete wrong approach to implementing schema changes, and suggest a better solution.