kstulgysK
Convex Community2y ago
6 replies
kstulgys

Whats the best practice/approach for saving and fetching convex images?

- Should I save storageId inside i.e product's table i.e
thumbnail: v.id("_stareage")
or should I have a separate table i.e
productThumbnails
?

- If I have multiple images (previous question also applies) i.e
images: v.array(v.id("_stareage"))
when I delete I need to make sure I delete in both places (storage and in database) right?

- Should I prefetch images in convex server side when I call i.e getProducts? i.e
return [...products, {...product, images: imageUrlsFromStorage} ]

Or should I fetch images client side where I have only storageId id?
Was this page helpful?