Should search be handled in backend workflows?

Hey there!
Im quite new to bubble and really happy so far with everything you can do with it. Im building my first product and have a question regarding search-functionality. Im building a kind of social media app where people can create posts and also search through posts. Now I finished the search functionality for my app but now I heard of backend workflows for the first time and how they enable a better performance.
Currently im doing the search in normal workflows, for example:
The user can search for all posts that are have a special categorie attribute. The results are displayed in a repeating group.

But thinking of how there could be potential 100k posts to search through, could I get performance issues down the road by placing the search functionality in normal workflows but not in backend workflows?

Thanks in advance for any reply!

Yes. But kinda no in practice.

Back end workflows run entirely separately from your front end.

So you would have to have something in the front end that notified the user when the search was done. Not impossible of course.

You can however use back end workflows to ensure you data is easier to search etc

2 Likes

Thank you @NigelG for your reply!

So If we stick to my example with the 100k posts does this mean my users would have to wait a long time to get their search results? :frowning:

I might be missing out but how do you search something in the backend workflows and display it back in the frontend?

Sure, we could do search actions in the backend but we don’t have the ability or actions that enables us to send data from backend to frontend, right?

Off the top of my head, the only way to send data from backend workflows to frontend is to use APIs

Impossible to say. Depends on your search.

If you can narrow it down with server side constraints (so directly in the search) then no.

A whole bunch of client side (so advanced filters and sorting) referring to other large tables … Probably.

1 Like

You can set a trigger on the page to wait for something to be populated by the backend.

I use then when the user is waiting for a pdf / CSV table to be populated. Which is a fairly common use case. Not sure it works as well with a search.

1 Like

Also check out how FB and Twitter do this and copy it. The first level search is usually ‘recent’ items and quicker. So you could structure your database around something like this.

I made a post about exactly this not too long ago:

I’ve experienced a significant uptick in processing speed on API workflows, with even very complex , multi-level embedded format as text/filter functions running in just a few seconds.

1 Like

just a note that it is a typical beginner mistake to ensure you build everything to scale already now.

you will not.
your database will change over time
your app idea will change.

search should be handled when several users all complain search is slow not after.

as an fyi, many people eventually offload search to apis like algolia or xano, which perform especially complex searches faster.
for basic searches, and you should do everything possible to make your database optimal for basic searches, bubble is fine

what is a basic search
do a search for with 3 constraints

what is not a basic search
do a search for: filtered:advanced where name contains A or last name contains B
or do a search for: nested do a search for

change your database in such a way that you do not use advanced searches. by adding the right fields to the datatype you are searching instead of needing to search through 2+ datatypes.

note you can still do that 1 year later using backendworkflows, which allow you to change 10,000 rows in your database within 10 minutes.

3 Likes

Unfortunatly for my app I needed the not basic search option.

Regarding the point you make about changing the database in a way that I dont need advanced searches I have a question to an example:

Like mentioned before I got Posts and all Posts can have 3 different Categories. Currently I made a option set for the Categories and Posts have a Datatype of “Categories” which is a list of Categories. Users can search for different Categories. For example the categorie “game” and “tutorial”. Now I want all posts to show that have either “game” or “tutorial” in their category list.
I currently have a filtered and advanced search that does this : “This Post-Categories intersect with Multidropdown-Categories value:count > 0”
It works fine but as you said I should try to handle this without filtered-advanced-method. How is this possible to do without it?

Thanks for your replies btw!

check this thread here