Using a combination of block storage and object storage for serving photos. Good idea

database-design

I have a real estate app and I need to create a database for listing photos. These photos will be actively accessed by users.

The full-size photos are about 50-70KB in size. I will create thumbnails for the first photo of each listing, which will be about 20KB.

Here's my plan:

  1. Store thumbnail photos directly on server (block storage), for faster access
  2. Store all the full sized photos in object storage

Is this a good optimization idea? Am I adding unnecessary complexity? Should I simply store all photos in object storage?

Best Answer

The problem with block storage is that you loose all the benefits of integrity constraints - photos will get forgotten when listings are deleted etc...

Block storage is likely to be faster and is easier to diversify if there are speed problems, so your trade-off is speed and scalability vs ease of development and management.