Search in database VS refer to text (number). Workload?

Hi fellow developer!

Could someone please help me out?

What is better in terms of workload and speed: Search the database or refer to a text (number) on the page?

> What I want:

Less workload and higher initial loading speed of the page.

Question:

Will every ‘look up in the database’ do its own lookup to find the same information? OR will it just do it once?
Would it be better to use a single text (number) element to refer to it?

Example:

‘Text current user’s amount of projects’. All conditionals and lookups will refer to this text, so there is no need to look it up in the database.

In my logic, these are all database lookups.

Does someone know the answer :slight_smile: ?

It should do it once. You can verify this in the network tab.

However, there’s a good chance Bubble still charges WU as if it ran a search every time.

With WU, the only way to know is to test and find out, and hope for the best.

Thanks for your quick reply!

First time I heard about the ‘network tab’. I will take a look!

In regards of the WU, good idea to run some tests.

Though I’m hoping someone knows this out of own experience. Then maybe this topic can also help others in the future!

Generally WU costs are incurred for the search, then the return of the data. Once a search is loaded there is a smaller additional cost for real-time updates to each piece of data that is updated in the DB. Best practice is to save your lists to a state so you don’t incur realtime data for when searches that return lists are updated (they cost a more than individual real time searches). Unless of course your intention is to have the lists updated in real time.

You can see this breakdown in the logs.

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.