In Firebase, you have collections that contain documents
Collections are just containers storing the same type of data
Documents are JSON object that should match our desired 'schema' (no actual schema, NoSQL DB)
In this ticket we need to plan out our data, the relationships between collections/documents, and specifically make sure we are able to query the correct data based on business needs. Keep in mind you cannot perform joins in firebase. There are great tutorials on how to model data on youtube, lets check them out.
Some things to keep in mind
Users
Restaurants
Meals (and various macronutrient properties, etc)
Meal ratings
A link to where you can order this food?
While it is convenient to store foreign keys on docs, keep in mind this might put us in a situation where we need to fire an initial query to get the foreign key, then a second query to get the data we actually care about. Firebase synchronously generates uids for each doc, so please read up on how we can do this efficiently. If we mess it up, we'll burn through our allowed usage and either get denied service or end up with a bill. DB reads/writes/mutations are important!
Once the data is modelled, lets make some TypeScript types to enforce correctness in the mobile app.
In Firebase, you have collections that contain documents
In this ticket we need to plan out our data, the relationships between collections/documents, and specifically make sure we are able to query the correct data based on business needs. Keep in mind you cannot perform joins in firebase. There are great tutorials on how to model data on youtube, lets check them out.
Some things to keep in mind
While it is convenient to store foreign keys on docs, keep in mind this might put us in a situation where we need to fire an initial query to get the foreign key, then a second query to get the data we actually care about. Firebase synchronously generates uids for each doc, so please read up on how we can do this efficiently. If we mess it up, we'll burn through our allowed usage and either get denied service or end up with a bill. DB reads/writes/mutations are important!
Once the data is modelled, lets make some TypeScript types to enforce correctness in the mobile app.