Muezz
04/01/2022, 2:53 PMNeedle
04/01/2022, 2:53 PM/title
command!
We have solved your problem?
Click the button below to archive it.sylar815
04/01/2022, 2:57 PMNeedle
04/01/2022, 2:57 PMMuezz
04/01/2022, 2:59 PMMuezz
04/01/2022, 3:13 PMTransactionModel
and then use that to write the transaction to ONE collection in my firestore database. What that means is that if eventually the user adds a million transaction, there will be a million such documents.
That is the case of writing data. Now a user may have multiple accounts and to calculate each account's currentBalance
, I add all of the credits, add all debits and then I have the currentbalance = totalCreedits-totalDebits
.
This kind of reads are done for each and every account and many other features in the app (profit/loss,monthly transactions, etc etc).
Issue # 1: The querying in firestore is extremely complicated and I have to work with compound indexes AND having multiple where
statements for each query is hard to work with. I fear that as the app scales up or the data stored increases, this would only get worse and the read times would increase.
Issue # 2: What happens if there are lets say a million documents? Would that affect the read times given this context?
Now there is Supabase and I have been looking into this since yesterday. It has an SQL based database which means working with queries would be much easier. But the second issue is still there. Would I still have to worry about read times in the calculation of lets say a particular currentBalance
when there are a million transactions in a table?sylar815
04/01/2022, 4:15 PMsylar815
04/01/2022, 4:15 PMMuezz
04/01/2022, 4:32 PMMuezz
04/01/2022, 5:20 PMMuezz
04/01/2022, 5:21 PMMuezz
04/01/2022, 5:21 PMBicijay
04/01/2022, 8:41 PMMuezz
04/01/2022, 9:11 PMsylar815
04/02/2022, 3:42 AMMuezz
04/02/2022, 7:36 AMNeedle
04/02/2022, 10:26 AM