Retool App is too slow

Hi,

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.

Attached is the JSON file.
Pit Trading Game - V6 - Final - 3.json (192.6 KB)

1 Like

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.

2 Likes

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.

1 Like

Hi, thank you both for your suggestions and info. Ill try look into websockets and see if that helps.

Will come back here with my updates.

Thanks again!

1 Like

Hi @Sally,

Keep us posted! Is it imperative to have multiple queries are triggered periodically? It might help to hear more about your use case.

Depending on what you're looking to do, you might be able to leverage Workflows :thinking:

1 Like