iam working on a markeplace site. there are 3 section which could display the relevant repeating group based on the filters. Currently, I’m performing a search directly in the repeating group’s data source for each section. iam wondering whether preforming a single search during the page load , storing it in a custom state and retrieving it would be beneficial in terms of workload units.
The problem is this data type i am displaying, has a considerable amount of records and is expected to grow. can custom states handle large amount of data?
Use a method of hidden variables instead of states.
You will lose state value on page load, it’s temporary.
Have a popup, and a rg there and add the data and source to it
You can Reference this multiple times and also add any extra filtering if you want.
1 Like
Everything gets reset on a page refresh. The only way to store data between sessions is browser storage.
The problem is this data type i am displaying, has a considerable amount of records and is expected to grow. can custom states handle large amount of data?
Yes states can store large amounts of data. Doesn’t matter where in Bubble you store your loaded lists they all theoretically aupport large lists.
I stored a list of 60 000 texts once. Bad idea in hindsight because issues can arise when
- you try to store the data all at once
- You run a filter operator on it.
How large is your list?
1 Like
states = temporary data stores
repeating groups = real time database data
use states to temporarily store data for instance - user opens a pop up and drag and drops the order of a list of things - store that as states and when the popup closes or user clicks button then send the data to the database.
it is usually most performant to do the search in all 3 places you use the data - it’s not ideal from a dev perspective because it creates excess work (much easier to add 1 source and then just apply filters for the different areas) but it’s the most efficient in terms of bubble server usage.
ie if you have 1 repeating group that shows a list of the data paged to 10 entries
then you have counts or sums of all that data in cards on the page…
it’s most performant to search and aggregate on the bubble server and then send just the number to those summary cards
vs
reference the repeating group with 1000 records and then aggregate the data on the page - this forces bubble to send all the data for all the records to the page to then aggregate it (instead of just sending the 10 records in the first page of the repeating group and then lazy loading the other pages).
I’ve tested this a lot and there’s a big difference in WU costs. server side aggregations are very cheap vs client side aggregations that force the whole list of data to be sent.
1 Like
iam aware that states looses value once loaded, but what if i add a workflow to set the states when the page is loaded.
also the hidden variables thing sounds interesting, can u explain how do i refer it to the repeating group (iam a newbie)