Enhancing API Performance: Does Self-Hosting Retool in My Local Region Help?

Hello Retool Community,

I'm currently exploring ways to optimize the performance of our Retool applications, particularly concerning API response times. We've been using the cloud-based version of Retool, but we've noticed that our queries and API calls are taking over a second to respond, which is not as fast as we need.

Our backend services are hosted in the South-East region on AWS, while I suspect that Retool's cloud services might be operating from a different geographical region, likely in the US. This geographical disparity, I believe, could be a contributing factor to the latency we're experiencing.

Given this context, I'm considering the possibility of switching to a self-hosted Retool setup within our Kubernetes cluster, located closer to our backend services. My hypothesis is that by reducing the physical distance between the Retool interface and our backend, we might see a significant improvement in the responsiveness of our APIs.

Before making this transition, I'd like to gather insights from the community:

  1. Has anyone experienced similar challenges with API latency using the cloud version of Retool?
  2. For those who switched to a self-hosted model, did you observe noticeable improvements in API performance?
  3. Are there specific considerations or best practices to keep in mind when migrating to a self-hosted environment, particularly concerning Kubernetes deployment?

I'm eager to hear about your experiences and any advice you might have. Your insights will be invaluable in helping us make an informed decision and potentially enhance our application's performance.

Thank you in advance for your time and input!

Have you tried changing the default Retool outbound region for queries setting?

click your profile avatar in the top right corner, then go to Advanced and look for the Other Options heading:

sorry I can't answer any of the self-hosted questions, I've only used the cloud version, but do your queries use the REST API Resource or maybe workflows? If you're trying to get the best response times before fully committing to the switch I'd suggest seeing if changing one or some to the Run JS Code resource type and handling the fetch call in code manually speeds anything up.... Retool naturally has overhead when using the other resource types, using JS directly can sorta skip over some of this. To go full on efficiency mode you could make a custom component for your API calls and data processing.

you could also try using a service like webhookrelay which lets you make a websocket connection to their service which you can have api calls send their response to. I'm not sure if it'd help or not, but the service is designed for this type of stuff so they probably have a bunch of custom stuff to handle api responses as fast as possible where retool might have overhead for security checks... the response is streamed to you so you wouldn't be adding overhead there. this also requires a custom component tho. I have a post here w the script tag and basic code to setup the websocket