Hi everyone,
I’m hoping someone can help me settle on the right DB structure for my situation that optimises for speed and performance at scale.
I’m running a marketplace that allows both parties to upload photos, manage those photos, enrich them with information such as a description, as well as being able to reorder them.
Taking one side - Locations - as an example, the following user needs are:
- Photos are displayed on the location page
- A location owner can change add new photos
- A location owner can delete photos
- A location owner can add a description to a photo
- A location owner can reorder their photos with drag and drop
Essentially, I’m recreating a location page exactly like AirBnB (just not a travel marketplace) and the location owners would need to manage the photos for that location.
So far I see 2 options.
Option 1:
Location with a list of Location Photos
This feels easier but I’m worried that on pages that load all locations, it means it will load all the images of all the locations as well, which feels risky. Or is the degree of separation by having the image itself on the Location Photo data type enough?
The dual way ownership will also be annoying to manage during creation.
Option 2
Location with a single Location Photos with a table of Location Photo
This feels like it would perform better but is more layers to manage.
Appreciate any tips you can provide, thanks!