Increasing my paid plan would increase my API workflows speed?

@pachocastillosr if I understand everything correctly, your solutions sounds very good. This would mean a data type “base meal” and a data type “client extra” (for instance for the specifics of a client in top of base meal). As soon as everyone has a meal (base meal + client extra, do a search for both and ty together in the frontend as you suggested) it becomes easy. Even changing the base meal is done in a second because you said it only is done once and every user uses that base meal.

I think you got almost everything right! However, what makes editing the base meal take 3 minutes is that each data type “base meal” contains a list of data type “food items”.

Example: Apple is a food item with data fields like name, original quantity and picture.

If the dietitian replaced the apple for a carrot in the base meal plan, the client meal plans that where already generated would now show Carrot, instead of apple.

So, if a dietitian would like to modify an existing base plan, I think that I would have to copy all the food items to generate a new identical version of the previous base plan that he can now modify, without messing with all the client plans that depend on the previous version of the base plan.

So copying this bunch of food items is what takes the 3 minutes, but I don’t see any other way to do allow dietitians to modify or delete food items without messing with the previously generated client plans that are related to this food items that the dietitian wants to change.

What about making also a separate data type “food item”? You can then specify per item, an apple for instance, as much as you like. Data type “base meal” is than a list of those food items. This way you are very flexible and no need to change everything.

Yes, right know “food item” is a data type. And “base plan” is a data type as well.

“Base plan” has a data field that is a list of “food item”.

“Client plan” is another data type which also has a data field which is a list of “food item” (the same food items that are in the base plan because we don’t want to copy them and create duplicates).

So if the dietitian deletes one of those food items on the base plan, the food item would be deleted in the client plan as well. That’s what I’m trying to prevent

You need a Copy-On-Write solution. Instead of copying eagerly every time, you should copy only when changes are made. I’m not a Bubble guy so I don’t know the details of that yet.

It requires planning the database structure carefully so that even when you need to copy, you are not copying the whole thing. But if you are willing to share, you can describe what your data types look like. Are the 200 items the data types?

2 Likes

Hi! Yes I think you are right! That’s exactly what I will try, only copying the item IF it is “modified” or “deleted”.

So the modification or deletion will never happen actually, the user will think it did though. The item would not be actually modified nor deleted, it would just be removed from the front end and switched for the copy.

This is what you are suggesting right?

The 200 items are data type “food items”.

Yes. Something similar to that.

1 Like

What I mean is that you need to reference the food items in the base and client data type. So you have one data type with the food items and you have a reference field if this type in both base and client. On client you also have a reference to base.

This means that you have ID’s in the client data type that will point to the ID of the base plan and you have a reference field with the ID’s of the Food items.

Than you do not need to copy anything . You reference to one data type everywhere. This means if you change the base plan you only have to change the food items you reference on the data type base.

@sem think that maybe you did not understand me correctly or I don’t uderstand you, this can be confusing hahaha.

The idea is that I can modify the base food item without the client food item being modified.

But if I have the client food item referenced to the base food item, then it would be modified automatically if I modify the base food item (this is what I do not want to happen).

You can have many base types and reference to the correct base type only.

So I have a reference to base 1
You have a reference to base 2

Something like that

1 Like

Thanks! Yes, that’s what I’ll do! Thanks for all your help it was very useful

You can also take a look at some other no-code external backend solutions, they might be the right solution in your case :slightly_smiling_face:

I’m especially thinking of Xano, which is quite easy to use and very powerful

https://bit.ly/32WC6PX

Yeah, you’re correct – But the OP would’ve seen capacity spikes if this was the case, I would think.

What’s “OP”?

OP == Original poster… which is you :slight_smile:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.