[Performance Tips]


Scenario (edit a Product) -

  1. Make Change to a Thing
  2. Change a thing with “Input Value”
    Only When ( Input value is different than database record )

My Question -

  1. When Save button pressed, Save the input value to database ( no matter same or different )
    ( input’s initial value = called from database )
  2. Have the App check whether the Input has different value, Before update to database.

Which one is Faster?
Does no.2 still query database at lease once? Or when the apps load Input’s initial value, data already cache?

For the sake of security, Bubble must make another query into your database because the value may have been changed by another workflow/user a second ago ( it’s unpredictable). If you want to cache it, you can save it as a custom state, this will make the process much faster, but I don’t know if it is the best way as, as I already pointed, the value may have been changed a second ago.

So, in the end, if you don’t have a reason to check. Don’t check. Just save it into your database.

1 Like