# Moving to Xano? Optimize Your Bubble App First

> Before moving a Bubble app to Xano, cut workload units in Bubble: leaner searches, privacy rules, JavaScript with Toolbox, external servers and Algolia.

- **URL**: https://www.nocodetalks.co/blog/should-you-move-to-xano-tips-for-optimizing-your-bubble-app-first
- **Site**: Nocodetalks, a one-person product studio that builds finance tools for US accounting firms, CFOs and fintech founders
- **Contact**: ankur@nocodetalks.co
- **Free 30-minute audit**: https://cal.com/nocodetalks/quick-catchup-30-min

---

[I now build finance tools for US teams ](https://www.nocodetalks.co/)

# Moving to Xano? Optimize Your Bubble App First

May 15, 2024 · 3 Mins Read
Published By [Ankur Khandelwal](https://www.nocodetalks.co/)

Since I started the [Xano Cohort Program](https://www.nocodetalks.co/courses/xano-cohort), the most common question I get is:

## "Should we also move to Xano?"

I often explain in detail how transitioning to Xano can help manage high workload unit bills. Additionally, there's a trend of people posting online about moving away from Bubble due to these high costs, such as

[![Tweet by Andy Smith saying it is time to say goodbye to Bubble because his bill would jump from $35 to over $1500 a month, with a workload chart](/_astro/andy-smith-tweet.Ues-B6PH_kpNQt.webp)](https://twitter.com/andy%5Fcb%5Fsmith/status/1787465490735972461)

Before deciding to migrate your app from Bubble to Xano, there are many optimizations you can perform within Bubble. In this article, we'll delve into how you can optimize your Bubble app to potentially avoid the need to move to Xano.

### Optimize Your Bubble App Workflows

1. **Optimize your "Do a Search For" action:** Try to fetch only the necessary content for the frontend. Use constraints to limit data and privacy rules to specify which user data columns need to be fetched.
2. **Use privacy rules:** Privacy rules not only secure your data but can also reduce workload units (WU). Restrict unnecessary columns so that less data is fetched, which lowers WU usage.
3. **Set default element visibility:** Keep elements invisible by default if they are not required on page load.
4. **Search count optimization:** Instead of using "Do a Search for count > 0", use "Do a Search for count > 1". The former costs around 12 WU while the latter only about 0.2 WU.
5. **Client-Side actions:** Use client-side actions for non-sensitive data to reduce WU.
6. **Limited use of advanced filter:** The advanced filter on the "filtered" function forces Bubble to search row by row, which can spike the WU and not take advantage of indexing. Therefore, try to eliminate the filter or use it less frequently.
7. **Monitor and optimize WU usage:** Continuously monitor your WU and focus on optimizing workflows causing the highest WU. Use the "Workload Unit" chart in the Logs ⇒ App Metrics section. Avoid getting caught in the trap of over-optimization.
![Bubble App Metrics: Workload by Activity chart split into workflow, page load, fetching data, file uploads and API](/_astro/workload-by-activity-chart.BFLG5hhJ_ujaYG.webp)

### Optimize Your Database

1. **Database optimization:** Avoid unnecessary calls to the database; always look for ways to optimize data fetching.
2. **Use Bubble data API:** For bulk insert and update operations, use the Bubble Data API rather than "Create New Things" in a loop or "Make Changes to List of Things". Note that there's a hard limit of 1000 records when using the bulk create feature. Use batching with the Data API.

### Utilize Plugins or JavaScript in Your App

1. **JavaScript for workflow reduction:** For tasks like looping over a list, use JavaScript with the "Toolbox" plugin to reduce WU-consuming workflows.
![Toolbox “Run javascript” step with a for loop](/_astro/toolbox-run-javascript.8xdK4Lya_20h9tK.webp)
2. **Backend workflows with JavaScript:** You can also use JavaScript in backend workflows for tasks like formatting JSON objects or processing a list of data. This saves significant WU.
![Toolbox “Server script” step in a backend workflow, which runs Node.js on AWS Lambda](/_astro/toolbox-server-script.DLlB2FRI_Z113deB.webp)
3. **Custom plugins:** Don't just use plugins to extend Bubble's functionality; use them to consolidate multiple steps into a few lines of efficient code. You can even create private plugins to handle heavy operations on Bubble's server, reducing your WU.

### Use External Servers (e.g., Cloudflare Worker, AWS)

When in-app JavaScript isn't enough, consider setting up an external server and calling it via the API in the Bubble. This can be very cost-effective, sometimes even free (e.g., Cloudflare Worker for up to 100K requests per day).

You can use Bubble Data API to interact with external servers and update the Bubble database directly, bypassing Bubble actions and saving WU.

**Example:** If you're developing an AI for HR that processes survey responses and generates reports, you can offload this computation to an external server. Call this server via the API when you need the report, optimizing your app and saving WU.

### Use of Algolia

If your Bubble app is search-heavy or you're building a content search platform with public data, consider using Algolia. It provides faster search capabilities and reduces the workload on your Bubble server.

### Conclusion

Optimizing your Bubble app can significantly reduce workload units and improve performance, possibly avoiding the need to switch to an external system like Xano. However, if you find that these optimizations are still not enough and you require enhanced database capabilities, then moving to Xano or another external database service might be the best solution.

This guide aims to address your concerns about whether to stick with Bubble or transition to an external database. If you need further assistance in optimizing your Bubble app, feel free to schedule a call with me [here](https://www.nocodetalks.co/bookacall).

### FAQ

**Q:** Will my Bubble app be secure if I use an external database?

**A:** Absolutely. The security of your Bubble app when using an external database hinges on how well you configure and manage both your Bubble app and the external database. Ensure that communication between Bubble and the external database is secure, using HTTPS and proper authentication methods.

**Q:** Will Bubble become slower if I use an external backend or database?

**A:** No, Bubble will not necessarily become slower if you use an external backend or database. In fact, if managed correctly, an external backend can improve performance by offloading heavy computations and large data operations. The key is to ensure efficient API calls and data handling. Use pagination and data caching where possible to minimize latency.

**Q:** My database operations incur high workload units—do I need to learn Xano?

**A:** Before committing to learning Xano, try the optimization techniques outlined in this article. These include refining your searches, optimizing workflows, and using privacy rules effectively. If these strategies don't sufficiently reduce your workload units, then exploring Xano or another external database solution might be necessary. Xano offers a robust API-centric approach that can handle complex data operations efficiently.

**Q:** How can I optimize the speed of backend API workflows?

**A:** Use JavaScript in your backend workflows via the "Toolbox" plugin to streamline multiple operations into a single, efficient script. This method can significantly reduce processing time and workload units. Also, consider asynchronously running secondary tasks so that primary operations can execute faster. Use efficient data structures and algorithms to minimize computational overhead.

**Q:** My Bubble database contains a lot of data. What is the best way to display it while saving workload units?

**A:** To efficiently display large datasets, use repeating groups with pagination. This approach helps load only a subset of data at a time, reducing initial load time and saving workload units. Use constraints and privacy rules to limit the data shown based on user needs and roles.

## More from the archive.

[All earlier no-code work](https://www.nocodetalks.co/archive)

- [Jun 14, 2024 How to structure databases 3 Min](https://www.nocodetalks.co/blog/how-to-structure-databases)
- [Jun 10, 2024 Bubble Security Checkout points 5 min](https://www.nocodetalks.co/blog/bubble-security-checkout-points)
- [Apr 8, 2022 Is Moving to Xano the Right Choice for Your Project? 3 Mins Read](https://www.nocodetalks.co/blog/is-moving-to-xano-the-right-choice-for-your-project)
- [Mar 15, 2022 Mastering Workload Units in Bubble: Strategies for Efficiency 1 Mins Read](https://www.nocodetalks.co/blog/mastering-workload-units-in-bubble-strategies-for-efficiency)
- [Feb 28, 2022 Launching Xano Cohort Program 5 Mins Read](https://www.nocodetalks.co/blog/launching-xano-cohort-program)
