Closed junhyap closed 1 year ago
Branch i180-add_vet_concerns_to_notes created!
@skyheat @NicholasChoong In #157, the vet concern frontend form takes in additional info. Should I remove them and follow this schema or would you like to add the extra info? Additionally, should I also add the visitId to the schema?
@skyheat @NicholasChoong
In #157, the vet concern frontend form takes in additional info. Should I remove them and follow this schema or would you like to add the extra info? Additionally, should I also add the visitId to the schema?
Yours is better and yea add the visit id and the visit date or time stamp.
@NicholasChoong Looking at the schema again, is it necessary to add the visit date, petnames, email and username when we are already storing the visitId, userId? Having the extra info will reduce extra reads later when displaying the concerns later, but I feel like that might affect the integrity of the data when somebody changes any of the visit or user info.
Firebase recommends us to denormalise our database which means storing redundant info to speed up read. The way to tackle that problem you mentioned is to create a function that will edit the other documents that is related to the edited document. Hmm, im not sure which is more cost effective though. A trigger function that updates multiple documents but will only require one read to access the incident/vet concern or a relation table that requires 2 read to access the docs.
I have updated the schema but feel free to experiment with it.
Firebase recommends us to denormalise our database which means storing redundant info to speed up read. The way to tackle that problem you mentioned is to create a function that will edit the other documents that is related to the edited document. Hmm, im not sure which is more cost effective though. A trigger function that updates multiple documents but will only require one read to access the incident/vet concern or a relation table that requires 2 read to access the docs.
I think accessing the docs would be more cost efficient compared to the trigger since we have more reads than writes. I will follow the schema for now, should be easy to change in the future if we need to.
I have updated the schema but feel free to experiment with it.
Thanks! :)
Is your feature request related to a problem? Please describe. Vet concerns are currently not added to the notes of the specific visit.
Describe the solution you'd like Vet concerns should be added to the notes of the specific visit. And also add the vet concerns to a collection called
vet_concerns
. The schema for the document should be:Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.