Forum Academy Marketplace Showcase Pricing Features

When you send data to a page

When you send data to a page what are you sending exactly? For example if you send data type user to a page are you sending just the user ID or are you sending the fields along with the data from those fields under that user as well. For example if a user has field “name” and a list of hobbies, and an age represented as a number as fields, will that those be sent to a page, when you send data type “user” to page upon navigation? Or are those loaded seperately as needed? Trying to optimize speed of page loads and am a bit confused on these things.

@NigelG you seem to understand the page data pretty well. Thoughts?

Hello,

While I’m no Bubble back-end pro, my best thought here is that nothing besides a “link” to specific data in your database is actually being “sent.” When you send data, you’re really just passing on some string of code to let the next thing know what to read from your database. Size-wise, this isn’t like waiting for files to upload/download because of “how much” data is attached to that link.

It’s really what happens on the page itself that needs to retrieve data to display. If your User page has a repeating group with 100 fixed cells, and each cell needs to display text pulling from 10 different fields and you have all sorts of API workflows being run - things might take a moment. But, if you have the same User page with a 5 cell repeating group and nothing more, that page might load faster; same user with the same data.

Think of Facebook - When you click on a link to go to a very popular business page with 400 posts, the page loads at the same speed as a page with less data. But notice that only a dozen or so posts on the page are loaded at one time; otherwise, it would slow down significantly to load all 400 from the beginning.

I hope someone will chime in with a more technical explanation too…


Gaby | Coaching Bubble

1 Like

Thanks for that explanation and it does help clarify things.

I am basically at a crossroads where I am trying to determine the best way to optimize loading times.

I will try to explain what I am doing and maybe you can provide some feedback.

Let’s say I have a number of “Type” items with a field called parent user. Each item also has field: name and field: category.

Item A - Category 1
Item B - Category 1
Item C - Category 2
Item D - Category 2
Item E - Category 1
Item F - Category 3

and so on.

Now I have 5 repeating groups on the page each which displays a category. So repeating group has a search for item with a constraint of item parent user = current user and another constraint of Category = Category 1, Category 2, etc

Now that might work when the database is small but let’s say there are thousands upon thousands of items. The search for these items would slow down as more and more users add items to the database.

If I give a user a field called List of Items, which would be a list, would it be more efficient to have the repeating groups call the User’s list of items and filter them on each repeating block.

So the repeating block would say User List of Items:Filtered “with constraint, Category = Category 1”

Would this be more efficient then using the search for item with constraint "Parent user = current user, and Category = Category 1 “or 2, etc”

And would the answer change depending on the number of items in the database? Say 1000 total items versus 1,000,000 total items.

I will owe you a cyber bottle of wine for this one.

Thanks!!!

Ah, this is a good question. From what I understand, more constraints are better than more filters if we’re talking about speed here. So, your “Search for Items” with the user and category constraints should perform better than User’s list:filtered and with constraint.

I think you should test it. There are sample data CSV generator things that allow you to download a file with dummy data, like this one: https://www.mockaroo.com/

Upload a file with 100 entries and then upload thousands more (entries) and have 2 different pages with these two different search methods. I would be very interested to see what you find.

Thanks for the link. I guess more constraints on the search is better because perhaps the database indexes itself perhaps according to those constraints automatically in the backend? Would this be accurate?

According to this, I’d say so:

Are we thinking correctly here @emmanuel ?

That the database indexes itself according to constraint in the backend automatically?

Sorry, I don’t understand the question…

What I am asking is in terms of scaleability. As you get more and more things of a certain type in a database doesn’t the length of time it takes to search all those things increase? Or does the total number of records to be searched not impact the time it takes to search, due to database organization or something like that?

If a person were to have a very successful app through Bubble, and have millions of records of a certain type, wouldn’t the search for function be rendered almost useless due to the ever growing number of records?

Well as the database gets bigger, things get more challenging, but we’re using a backend that scales well (Postgres). Now that’s an ongoing work. However this is not something you should worry about, that’s on our end. You should be building your app in a way that makes sense (and use searches over filters).

1 Like