Bubble.io has recently announced a new pricing model for its users. Main price factor is so called “Workload Unit”. It measures computational resources required to perform application logic, such as data fetching, executing workflows, uploading files, loading pages, and making API calls. Workload units are allocated to these actions based on their complexity, with more intricate tasks consuming a greater number of units.
Bubble’s new pricing model:
How to decrease workload of your Bubble app?
Workload optimization is not a rocket science. There are several areas which affects your workload consumption. Let’s split it into few areas and we’ll provide tips how to make your app more efficient within those areas.
Data fetching, manipulation and structure
- Advanced filters: Don’t use advanced filters unless necessary. Bubble works in a way that this filtering works on client-side, which means you need to fetch more data from back-end and filter it on front-end. If you can perform the search with standard “Do a search for”, use it.
- Use single data source: When fetching the same data on several places or in more steps within a single workflow, try to re-use the data source when possible. For example you have a repeating group with list of orders and you want to access the list of currently filtered orders, avoid adding additional “Do a search for” within a single page, but use Repeating group’s “list of …”
- Use cached aggregations: Bubble allows to perform cached aggregations on lists of data. Use this especially if you are working with the same list on different pages and everytime you need to perform the same aggregation.
- Or use stored aggregations: When you don’t need to perform real-time aggregations on your data. That is mainly on lists which are “slowly changing”, store the calculated value and update it when necessary.
- Don’t create “things” because it’s easy: Been there, done that. Shame on us. It’s a common (although not good) practice that Bubble developers use database records to store temporary data. This can often be convenient because it’s easy to manipulate with the data but all of these data operations require additional workload usage. Avoid using database records for storage of temporary data and instead, try to use custom states instead.
- Normalize your database: Use more data types with less fields instead of trying to fit all data into a single data structure. This way Bubble will be able to fetch data more efficiently
- Data search within a cell in repeating group: Let’s say you have a repeating group with 50 rows. In each row you are performing a “Do a search for …” operation. That’s 50 database queries within a single page load. PER USER. There must be a better way for this.
- Use DATA API for bulk data operations: When you need to perform (especially create) operation on a list with at least 20+ records, don’t use Bubble workflows. Instead learn to use Bubble’s DATA API which can significantly improve performance of such bulk operations.
- Autobinding vs make changes to a thing: Autobinding is a powerful feature but again, it can be costly from WU perspective. Unless autobinding is necessary and you need to make changes to more than a single fields, use make changes to a thing instead
Workflow optimization
- (not)Using “Do when condition is true”: If you have a complex workflow which is triggered by “Do when condition is true” or “Do every X seconds”, and it’s triggered frequently, it can quickly add up a lot of unnecessary workload units.
- Recurring workflows: It’s a powerful tool but use it carefully. Recurring workflows will basically run a workflow on each element on regular basis on list of records. This might be helpful but it can consume huge number of workload units as well
- Use result of step X: Instead of performing repetitive data fetching, try to use results of previous steps to access data which were used in previous workflow actions. Not only you will minimize the number of database queries but you can enforce synchronous order of actions if needed.
- Make changes to a list vs recurring workflow: In cases when you want to make bulk changes and the number of items is less than ~50, use “Make changes to a list”. If the number of items is greater, use recurring workflow instead.
- Frontend vs backend workflows: Executing te same set of actions is cheaper on front-end rather than backend workflow. That’s also intuitive, because in case of frontend workflows part of the logic is executed by your browser (i.e. your) resources instead of Bubble’s servers
Page loading and frontend optimiazation
- Use conditional expressions only if necessary: Remember that especially if you are using expressions which require data fetching, it will also consume workload units. Avoid using these expressions especially in repeating groups, where the condition must be evaluated pear each cell separately
- Single vs multi page apps: Each page load consumes workload units. Therefore try to use single page if possible, as it doesn’t require to reload the page and load data which might be already downloaded in previous page
How to monitor your workload usage?
Fortunately, we can drill down into very specific detail of what is driving your app’s WU consumption. Bubble has an interactive WU dashboard where you can see exactly which opearations and which data searches are consuming most of your workload units.
Are you interested in free consultation of your existing Bubble application? Let’s schedule a short call and we can provide high-level recommendations how to improve your existing Bubble app.