Retool best practices and general questions

I've been using Retool for 3 months now and wanted to get some advice on whether the workarounds I've come up with are best practices, or if there's a better approach I should consider.

  1. Navigation as a Module:
    I have 10+ apps, and I tried moving my sidebar navigation (7 links) to a module for reusability. However, when I implemented a button to shrink the sidebar, the words and icons started behaving inconsistently. I ended up copying and pasting the navigation across all apps. Is this an acceptable approach? I read that modules don’t improve performance, so am I just losing some maintainability by doing this?

  2. Workflows vs. Query Handling:
    Currently, I use the query library to manage shared queries across apps, along with app-specific resource queries and JavaScript queries for data formatting. For example, I run a handleCreateOrg query, which formats the form data, triggers the createOrg query, and then runs loadOrgs on success. I can replicate workflow functionality with onSuccess and onFailure, but would using workflows be better practice? I’m still on the free plan, and 500 workflows per month seems limiting as I know I will fail a bunch of times, so I’ve been hesitant to adopt them widely. Is my reasoning sound?

  3. Self-Hosted vs. Cloud-Hosted Retool:
    How does self-hosting Retool work? It seems I’d still need an enterprise plan for features like workflows and modules. If I self-host and close my network for internal use only, will it still function, or does it need to communicate with Retool servers? My assumption is there is some digital license similar to Windows OS and it would only communicate that to retool to validate my plan.

  4. Handling a Large Number of Queries:
    One app in my setup is accessed by two others, each fetching data and populating it slightly differently. This leads to a lot of JavaScript handling for queries and component management. Would it be better to duplicate this app so each has its own version? It would simplify the queries and code, but it’s a large, multi-layered form, though I could use a module for that. Is duplication a viable solution, or is there a better way to manage this complexity?

Looking forward to your feedback!

2 Likes

Sorry one last thing, for the queries usually to do something it takes 4 queries so far only one app uses it but I got to a point where now multiple apps need the same process so now I have to copy and paste all 4 queries to each app. Would using workflows prevent this?

Hey @Felix1 - welcome to the community! :wave:

Navigation as a Module

Totally fine! Like you mention, the primary tradeoff will be maintainability. Modules are great but they haven't received a ton of development time recently so I'm not surprised to hear that there might be small issues here and there.

Workflows vs. Query Handling

All other things being equal, I'd say it's mostly a matter of personal preference. Workflow logic is generally easier to read - and thus debug - than chained queries, but they come with that ceiling of 500 monthly runs and thus aren't suitable for every use case. The big differentiator for a workflow is the ability to run without interacting with Retool at all.

Self-Hosted vs. Cloud-Hosted Retool

Your intuition is correct! A self-hosted Retool deployment will verify its license key every 6 hours. It also reports back minimal info about how the instance is being used - number of users, active app editors, etc. - but is otherwise responsible for its own data storage, thus allowing customers the flexibility to utilize whatever infrastructure they want. This isn't gated behind an Enterprise plan, either; any user can get a license key here and spin up their own self-hosted instance. I'll note that we do support air-gapped deployments that are completely offline, but it's not a particularly common phenomenon and does require an elevated plan, I believe.

Handling a Large Number of Queries

If I understand correctly, you have two apps both writing data to a third? If only to avoid data collisions, I imagine that it might be beneficial to break out the one app into multiple copies.

Sorry one last thing, for the queries usually to do something it takes 4 queries so far only one app uses it but I got to a point where now multiple apps need the same process so now I have to copy and paste all 4 queries to each app. Would using workflows prevent this?

Yes - assuming that you are utilizing the same sequence of queries in multiple apps, you would be able to consolidate this logic by utilizing a workflow. You could accomplish the same thing with the Query Library, though!

1 Like

Thanks for Darren for replying clears up a lot.
For others references I found out that if you leave the margin to normal for your modules then when you shrink the sidebar from medium to small it will hide the text and only show the icon.

Also it would be great if query libraries support javascript code but now that multipage apps are a thing it makes everything extremely easier.

1 Like