Moving to Xano? Optimize Your Bubble App First
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
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.
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.
Set default element visibility: Keep elements invisible by default if they are not required on page load.
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.
Client-Side actions: Use client-side actions for non-sensitive data to reduce WU.
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.
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
Database optimization: Avoid unnecessary calls to the database; always look for ways to optimize data fetching.
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
JavaScript for workflow reduction: For tasks like looping over a list, use JavaScript with the "Toolbox" plugin to reduce WU-consuming workflows.
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.
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 :
Category
Jun 14, 2024
How to structure databases
The most common and frequent question people ask - “How should you structure database?” and I am 100% agree that’s is the most important thing after app security.
Category
Jun 10, 2024
Bubble Security Checkout points
Security is often seen as a dull topic in the tech world. Everyone wants to read about it, but very few actually do anything about it.
Category
May 15, 2024
Moving to Xano? Optimize Your Bubble App First
Before deciding to migrate your app from Bubble to Xano, there are many optimizations you can perform within Bubble.
Category
Apr 8, 2022
Is Moving to Xano the Right Choice for Your Project?
When it comes to choosing the right backend service for your project, Xano emerges as a noteworthy contender.
Category
Mar 15, 2022
Mastering Workload Units in Bubble: Strategies for Efficiency
Discover the fundamentals of Xano, a powerful no-code API builder. Learn essential concepts
Category
Feb 28, 2022
Launching Xano Cohort Program
This newsletter will be a little different from the ones before. In this edition, I'm excited to launch the Xano Cohort program
Learn Xano
Xano 101
Additional
Coaching
Plugins & Templates