We are storing user balances on smart contract and as well as on our local db, so that we dont always have to query blockchain for user balance.
For this we use contract events to update balances but we observed that listening contract events are a hit or miss. In our cases 3 out of 5 events were missed by our node js server and thus leading to discrepancy in balances.
What is the correct approach of syncing balances between local db and smart contract balances.
How does these exchange companies manage that?