Hello. I have a couple questions regarding the architecture of using Moralis with dApps. The marketplace boilerplate is a good example to use for the questions.
In that example, the Moralis DB is syncing the âMarketItemCreatedâ event, which makes sense. The part Iâm struggling with is when someone purchases a marketplace item, it appears that the dApp itself attempts to update the database by setting that object âMarketItemCreatedâ to sold. Is this really a robust strategy? What if the client crashes or closes right after the transaction is started? What if someone does a direct contract interaction to purchase an item? Wonât the dApp be out of date then?
It seems like a better strategy would be to process âMarketItemSoldâ event from the server side directly from the blockchain and update the database accordingly. That way it doesnât depend on the dApp to update anything.
Am I totally off base here, or maybe missing something? If not, is there a way to design Moralis backend as stated above (use another event to update database)?
Thanks!