I built an app on Retool cloud, mainly using Retools DB and Firebase. I noticed the performance of the app is very slow and timeouts a lot.
Tried improving the performance by optimising some of the queries and simplifying the app but still noticing the poor performance when we have multiple using the app at the same time.
Is retool not built for such an app to be created.
How can I improve the performance without compromising on the features and functionality of the app I built.
Databases are built to compute and provide data at a certain rate, you are firing multiple queries per second here, every second. Depending on how large the data set becomes it will eventually overwhelm what the DB can do. It looks like you want a "duplex" connection here more akin to a telephone call where data is shared between client and server as soon as it is presented. This is maybe possible with Websockets but i have yet to figure out how to do this with retool.
You can mock a WebSocket connection via Firebase. Since there is no subscription Firebase option with the build in Firebase query tool you'd have to do it a little different. The only want to accomplish this currently is with a Custom Component (Firebase realtime updates - #13 by joeBumbaca). Within that you can set up your subscription to your Firestore collection and you will be update and receive data updates in real-time. This is all done within the JS/TS repository that is made for the application.
The pitfall with this is that the subscription data is only available within the Custom Component itself. I'm sure you could hook up a way to store it within Retool and fetch it elsewhere but that is the workaround I have been using in the application I'm helping build.