Help for Data structure best practice for (items images)

hello every one,
I just started using bubble for some months to start building my market place app, and i see it has high capabilities and features to do things, my issue that in some cases you can do same thing in different ways however always there is best approach to do it .

my question in short is related to adding products image ,
1- is it better to have it in separate Data Type (fields (image, selected product))?
or
2- is it better to have it as field in Product Data type with list of image?

I see both can work but for (option 1) , I reach for the images by (searching for.) which require to search for DB for (image with selected product) which may cause performance issue if I have large DB records for images or increasing server capacity use , is that right?
also I am not sure if there will be limit for database records in one day by bubble , then it will be big limitation for me, in that case (option 2) to have it as field with list images will be in same product database record and may will be better for performance as don’t need to have (search for.) to reach to images.
by the way i am doing fixed no. of 3 images for every product.

Appreciate your help for the best approach considering performance, capacity usage and future scalability .
Thanks in advance,
BR,
Waleed

Hello!

For me, this would come down to whether or not each image had additional information that needed to be stored about it other than the related product. For example, if each image could have a customized name, and “image type” (for example, cover image vs. thumbnail image), then it would make sense to store this information on a separate data type.

If each product simply contains a list of images with no additional data needed about each image, it is probably easiest to just go with a list of images on the product data type.

Some additional notes about do a search for vs. filtering on a list field:

  • At scale, list fields should be kept to relatively small lists of things (think <100 items)
  • When a list is expected to reach more than 100 items at scale, it is best to use a separate data type as it will be more performant to search and filter
  • Do a search for is not an inherently slow operation. We can search large data types at scale very quickly using constraints.
  • Using advanced filters on large lists or searches slows things down significantly

I hope this is helpful!

1 Like

Many thanks @sam.morgan for your detailed feedback.
appreciate it , it is really helpful.