Firebase: cloud storage high bandwith

Viewed 31

I'm making a Flutter app that is like social media, so uses pictures a lot. With that in mind, looking at the Firestore data, the reads with about 15 people look like this: enter image description here

But they are far outpaced by my storage bandwidth usage: enter image description here

I'm thinking about possible reasons why this is the case. First, I am not sure if this could potentially be a problem, but I save each user's images into a respective folder: enter image description here

Furthermore, looking through the images, I notice that file sizes average around a few hundred kilobytes, with a few being sized in megabytes, the largest I found is 9 MB. Are these too large?

Are there any other ideas I am missing? I am trying to implement caching on my front end to help with this problem, but I am open to any other possible reasons and solutions.

1 Answers

Furthermore, looking through the images, I notice that file sizes average around a few hundred kilobytes.

If you take a look, at the major social media apps, the average size is around a few tens of kilobytes and not a few hundred kilobytes. If you look at Instagram for instance, all images are around 40-50 kilobytes.

With a few being sized in megabytes, the largest I found is 9 MB. Are these too large?

Way too large.

Are there any other ideas I am missing?

Yes, resize the images before uploading them to storage.

I am trying to implement caching on my front end to help with this problem, but I am open to any other possible reasons and solutions.

For not reading an image from the server, each time the user uses your app, a caching mechanism will be helpful. However, it will not help the first time the user opens the app. When indeed it is needed to be downloaded.

Instead of having a single 9 MB image, it's better to have 180 images of 50 KB.

Related