Hi guys, I’m running into a bit of an architecture quandry. I think I know the answer but was just interested in seeing how other people go about the same scenario.
I have a billing part of my application, this comprises of various collections,
Payments etc. In the goal of trying to avoid data duplication and also errors, things such as whether the invoice is
late depend on using helpers to query across collections (ie: paid is when the total payments associated with this invoice equal the total price).
I originally thought this was the best way of ensuring the data doesn’t get compromised and also minimises the amount of columns needed to store in the database but am realising it does make querying/filtering this data really quite slow.
Do most people therefore to decide to store everything directly in the collection (and just set/update this data) on every insert/update? Or are there other ways of keeping things as they are but increasing the speed upon filtering?
Thanks in advance