I have developed a Daily Planner application that allows users to create an account, sign up and plan their schedule by the hour with tasks for each day.
I am using Firestore for the database and currently the way the app is structured is that there is a "day_packages" collection in Firestore. To simplify things, each document in the collection has an array of "tasks" and then a "timestamp" indicating the day it's for ("Thu-8-12-22") and a "user uid", which is specific to a user account. These two values give me a unique key, that will allow me to fetch and update specific days for specific users based on in app interactions.
However, as you can imagine, if a user makes a schedule for each day of the year, then that collection will have 365 documents for just that user. If you have a ton of users, then this collection will get very large over time I would think that querying by timestamp and user uid will start to take a performance impact.
One way to get around this that I was thinking about, would be to create a collection in the database for each user. The collection name would be the "user uid" and each document's ID in the collection will be the timestamp to uniquely identify them. That means that per year, the max amount of documents a collection could have for schedules per user, would be 365.
I was wondering if this is a correct way to use Firebase or if this is also inefficient? Is it wise to create a collection per-user? Should I just continue with how my data is currently set up or is this switch fine? Switching to collections per user would also allow easier querying as well.
Thank you!