Optimal Database Design - Advice?

Hi @ed727

Sorry to bother you…

I need to ask one last question to be precise. (I know you have answered above but I have doubt if I have understood it well)

This is my diagram showing the left column a bunch of Dropdowns and the right a Repeating Group that shows the results.

On the left column, every Dropdown is a constraint to the Repeating Group in the right. So basically you select a value on the list the Repeating Group will show the result immediately. (When the page is loaded it shows all the records because the constraints are empty - it’s my choice to be so)

On the Repeating Group (the right column), the Light Gray are text fields (in the main data type) the Dark Gray are SVG icons.

Big Dark Gray box that says Image Linked Field is a Search for and is searching the image from a linked datatype containing only images and a field linked to the Main data type. (As shown in the image below)

Now to my question :sweat_smile:

If I have for instance 100.000 records (multiply by 55 fields for each record) that will show on the Page Load or when the user fills the Dropdowns (still will load a few thousand)

What would Bubble do? Will load all the images on the client side (because is a nested search as I understand) and then do the search on the server side?

And what do you mean by:

If Bubble is only downloading the image links, then I wouldn’t think it would be too slow unless you had tens of thousands of image entries.

A little disclaimer: I will use Repeating Group pagination (still don’t know how that works) so it will only display 20 results, but I still don’t know if Bubble will load all 100.000 records even if I’m only displaying 20.

I hope I’m clear about what I’m saying :cry:

Thanks again
Fabian

P.S: I’m asking @ed727 but I will appreciate that if anyone can answer.

Hi, some answers:

If your search is entirely server side, then Bubble will download enough entries to fill what the RG container is calling for. I typically used scrolling RGs, so Bubble will download enough records to fill what’s shown on screen, plus a few extra in anticipation of the user scrolling. I believe pagination is similar but not sure.

When I say “nested searches” I am referring to a “Search for” that is needed in order to generate a constraint. Like the below… in my “Seach for X” box I have another “Search for”

image

What you have here is a search that needs to be executed to fill a cell in a RG. So basically, let’s say that the user ends up paging through and displaying 100 entries. Bubble will have to run 100 additional searches (one for each entry) to locate the image for each entry.

Those are all server-side searches, so only the resulting image will be downloaded. But still, it’s an inefficient and capacity-heavy approach since to show 100 entries you are asking Bubble to execute 101 server side searches (1 search for the results, plus 100 searches to fill the image fields for each result).

If each vehicle only has one image, then you could simply put a field in the vehicle record that connects to the image record. Then the RG cell only has to ask for that, and no search is executed. Or, just upload the image directly to the vehicle record. (However if you have multiple images and want to scroll them, then you may need a different approach.)

If you are looking ahead to building a database structure that will handle a large volume of records, I’d highly recommend the ebook that @petter wrote on Bubble performance. He goes into a lot of detail on this stuff.

1 Like

Thanks for the detailed answer @ed727
I really appreciate that.

If you are looking ahead to building a database structure that will handle a large volume of records, I’d highly recommend the ebook that @petter wrote on Bubble performance. He goes into a lot of detail on this stuff.

I already have it. And still, I have difficulties understanding his approach. (everything is related to itself)

Anyway thank you very much :smiley:
Fabian

P.S.: do you have any experience with Algoila?

Hey Ed272 - Thanks for the book link! Super helpful…