Store images in Firebase storage or document?

When storing photos from the gallery or camera, I’ve always used Firebase Storage. What do you all think of storing the raw base64 string in a document field instead? Pros and cons?

I would store them in Storage and would save the link to the image/video in the document.

Firebase is all about money and how much you will pay for traffic.

So if your users only upload small images I think base64 string do work well and will cost less money.

If your users upload high quality images then I would use the Storage.

It also depends on how much users/images you will have. With many users the read ability and the maintenence will be better with storage because of the subfolders and so on.

Also with base64 you always have to create a base64 string from images and reverse which you wouldnt need with storage.

Overall I would go with Storage:

  • Better Structure
  • Read ability
  • Less Code to upload/display images
  • Can cost less money if you do it right
  • And if you expand and get more images/users you dont get forced to change to storage while on production

If you have small static images and/or users dont upload images and so on go with base64.

This is my opinion, I can be completly wrong with that :slight_smile:

1 Like

Thanks. Makes sense. The images are basically from the user’s phone & camera, so they’re pretty good quality.

1 Like