Moving to Xano? Optimize Your Bubble App First

May 15, 2024

May 15, 2024

May 15, 2024

3 Mins Read

Published By Ankur Khandelwal

Share this blog :

Since I started the Xano Cohort Program, 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

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.


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.


  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.


  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.

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.

Share this blog :

Subscribe to Newsletter

you can talk related to project, Bubble developerment,

xano developement or you just want to chat

Subscribe to Newsletter

you can talk related to project, Bubble developerment, xano developement or you just want to chat

Subscribe to Newsletter

you can talk related to project, Bubble developerment,

xano developement or you just want to chat

Nocodetalks

Nocodetalks

nocodetalks@gmail.com

nocodetalks@gmail.com

Bangalore, India

Bangalore, India

Learn Bubble

Learn Bubble

All Bubble Articles

Bubble Database

Bubble Security

Newsletter

Learn Xano

Xano 101

Additional

Coaching

Plugins & Templates

Let’s build your app!

Schedule a call with us to discuss your needs, goals, and how we can work.

Book a Call

Let’s build your app!

Schedule a call with us to discuss your needs, goals, and how we can work.

Book a Call