So we are using an ethereum smart contract to store investor balances and also storing their balances in local portfolio tables. What would be the right approach to sync in a balance between ethereum smart contract and local db.
What I have in mind right now is to modify local db balance when making transaction call but then again if for some reason tx fails on smart contract level, it would create a discrepancy.
What would be the correct approach of doing this especially in production level ?