I have created a solidity contract to store the states and the data of a Dapp but to power the frontend, I need different view of that data! While I can use solidity as my backend but I don't think it makes much sense to have the complex logic of building the views on user's end! Furthermore, it would require querying 100's of variables to build the UI every time the page is loaded!
So, I have decided to create a backend database in sql/mongodb to power the UI and will use solidity events to keep the backend data in sync with the contract's state changes!
I am interested in knowing if this is the right thing to do or are there any other approaches that I can use to tackle the situation. Furthermore, what's the best way to listen for solidity events!
Do I need to run a ethereum node locally and use node.js to listen to events and make the necessary changes in database whenever there is a new event or are there any other easier options? A Rest api or something?