Inquiry about WU costs

I have a few questions regarding the new pricing format before defining which path to take for the optimization of my application.

1- Is the price for storing in the database indifferent to the number of characters?

For example: Is it the same to store in a field called “Name”, a name of 4 letters than one of 12 letters?

2- The steps of a workflow that have a conditional, are counted as WU if the conditional to be executed is negative?

For example, if I have a step that asks to save 20 names only if those 20 names contain a “J” and when the workflow is executed, no name with J is obtained, that step (not executed because the condition is not fulfilled), consumes me WU?

3- Finally, do we have a way to know how many WU 1 specific workflow consumes?

  1. There is no cost associated with database storage in Bubble.

  2. In your specific example there will be no WU cost… WU costs are only for server based actions.

  3. Your server logs will show the precise WU cost for every worklfow.

Perfect dude, you’re awesome, thanks!

But I have one more question for you, when the field of a thing has a default value and I create a thing and I don’t send a value to that field, it is supposed to store the value that field has by default, right?

In that case, that writing in the database consumes me WU?

In short, it could be recommended that I do not place any default value and that if the value is not given by me with the creation of the thing, it is better to remain empty? Or is it indifferent?

Example:

Thing: Person

Fields:

Name(text):
Corporate Email(text): Does not have (Default value.

When creating a new thing, a name is placed in the name input and the corporate email input is left empty because it is not required.

That writes me in the database the following:

Name = Peter
Corporate email = Don’t have

If I did not put a default value, it would look like this:

Name= Peter
Corporate email =

In both cases the WU consumption is the same?

Yes… it costs 0.5 WU to create a thing in the database. It makes no difference whether you set 1 or 500 fields… you’re only creating 1 thing, so the WU cost is 0.5

Full details of all WU costs are in the docs: What contributes to workload? - Bubble Docs

Wow ok, perfect! I thought each writing was 0.5, I didn’t know it was for each Thing. Thanks a lot brother. Much appreciated.

That is not correct! It really depends, drastically changes the workload costs (((

@cpo

It’s 100% correct - and extremely simple to test (which I just did to confirm).

I wish it could be true, but it is not… I’ve just received the answer from the Bubble support about it:

You’re correct that the Bubble documentation states that creating or updating a thing in the database typically costs 0.5 WU per operation, regardless of the size of the thing. However, Workload Unit (WU) consumption can vary based on several factors, which might explain why you’re seeing fluctuations from 0.5 WU up to 5 WU per operation.

Factors affecting WU consumption for “Create a Thing” “Update a Thing.” Let’s break it down for you:

Number of Fields Being Updated:

The base cost is 0.5 WU, but updating multiple fields in one go can increase WU usage. The more fields you modify at once, the higher the total cost.

Linked Data (Relationships Between Things):

If your object references other database things like lists or related records, Bubble may need to retrieve and update multiple records, leading to higher WU consumption. For example, updating a User record with a list of Orders can require multiple operations, each consuming additional WUs.

Privacy Rules Evaluation:

Complex privacy rules in your app mean Bubble has to check access permissions before processing the update, adding computational overhead and increasing WU usage. For instance, if a workflow needs to verify the current user’s edit rights before updating a thing, it adds to the workload.

Triggering Backend Workflows:

When an update action triggers a backend or API workflow, the overall WU usage goes up because Bubble processes additional steps beyond the initial update. For example, a database trigger event running when a thing is updated can lead to multiple actions in the background.

Bulk Operations vs. Single Updates:

Performing bulk updates (like modifying a list of things) in one workflow step consumes more WUs compared to updating records individually. Large-scale modifications, especially on lists of database entries, should be optimized to reduce unnecessary writes.

Option Sets vs. Database Writes:

Using Option Sets (stored statically) instead of writing values directly to the database can lower WU consumption. Consider referencing static data rather than dynamically storing and updating values in the database.

And this is my own example of executing the “create thing” operation (without any conditioning) which costs much more than 0.5 wu…

It always costs 0.5 Wu to write a new item to the database (I assumed that was what you were questioning - but perhaps not).

Of course, there are additional WU costs associated with everything in Bubble - that should be obvious (i.e. if you’re searching for other database items then of course you’ll be charged for retrieving them, but that’s not part of the cost of adding the thing to the database, that’s the costs for search and data retrieval).

In real-terms, adding a thing to the database costs at least 1.62WU (as outlined in the Bubble manual linked to in my previous response).

Number of Fields Being Updated:

The base cost is 0.5 WU, but updating multiple fields in one go can increase WU usage. The more fields you modify at once, the higher the total cost.

Well that’s certainly contrary to the manual, and to my own testing - but, as with all things WU related, I think Bubble support just make it up as they go along (I’ve never been convinced that anyone at Bubble actually understands how WU work in real usage).

In any case…

I would highly advise NOT relying on the manual nor Bubble support for WU related questions - just do your own testing, or (better still) just don’t worry about it, and accept it (or don’t) as part of using Bubble.

You can see on the screen the example when 202 actions “Create a new Thing” costs 561 WU. These operations were done without any condition evaluations. SO it means, not always, unforunately…

That’s absolutely true, but how it is…

Thank you for the advise! I do agree, but the fluctuations in my case are so hight (0.5 to 5 WU per operations) so i need to understand how to predict it. It really effect the use of the platform for my applications. With current consumption level it will easily increase 1M of WU per months((((

You’re misunderstanding how WUs work here…

  • It’s ALWAYS a cost of 0.5 WU to add a thing to the database - regardless of how many, fields are added, or how many characters are added to fields (which was the original question in this thread) - unless of course those fields required additional database searches or server actions to be performed, in which case those searches will incur standard data retrieval WU costs
  • It’s ALWAYS a cost of 0.6 WU to run a sever action (such as making a database insert)
  • It’s always a cost of 0.015 to retrieve a database item (usually rounded to 0.02 in the logs)

So all those things combined (plus any additional costs for data retrieval or other things) will add to the total WU cost.

But the cost for adding the database item itself, remains 0.5WU no matter what.

This may be a case of the bug that causes the total costs of the create actions that all exist within one series of actions that are greater than 0.62 to be applied to the last create action in the series…