Storing/Retrieving Key-Value Pairs in a List?

I’m trying to optimize my app for speed. One thing that’s causing slowness is needing to write data to Bubble, specifically creating 12 Things (let’s call them “ThingMinors”), each of which is a simple key-value pair (which will ultimately serve as a category label + value to be plotted in a chart). Each set of 12 ThingMinors associates nicely with another kind of Thing (call it a “ThingMajor”). The only way I can see to store/retrieve this data in Bubble is what I’m currently doing, which is to have a separate ThingMinor table with fields key and value, and then in table ThingMajor have a list field where I store each ThingMajor’s associated list of 12 ThingMinors.

It’s all perfectly logical, except it’s very slow. Specifically it takes Bubble ~25 seconds to create (or just update) the 12 ThingMinors during a workflow run. So my question is: Is it possible, in my ThingMajor table, to simply store a “list” of Minor key-value pairs (key=string,value=number), without actually having Minors as a separate Thing?

Otherwise, is there any more efficient way to write 12 simple records (ideally concurrently) to a Bubble database? I’ve read about trying to use an API workflow to write records “in bulk” but 1) this is hardly bulk and 2) it sounds like that’s unlikely to be any faster.

Feels like I’m stuck between supported use cases and don’t have any good options. Any ideas?

I think you actually mean a new data type such as “Hash” in [Ruby]

Yes, essentially.

@edd Did u find a good solution for this?

@seanhoots No, there really isn’t one. However, I did learn that database writes to linked tables can be executed MUCH faster with an upgraded Bubble subscription. If speed is your issue, then it’s worth evaluating what buying more capacity can do for you, and if that’s worth it to you cost-wise.

1 Like

Hey edd! I know this is an old post, but hoping you or someone can help me. How did you go about creating the set of 12 ThingMinors to Bubble? Did you create a separate workflow action for each?

I have a set of 70 to 80 key value pairs per object and I’m trying to figure out how to extract each as a record or Thing rather than having one Thing with 70-80 columns.