0

My project deals with Business, their products and customers. Every business, product and customer (user) has its unique ID. In my cloud storage, I have around 30 images. Image size is around ~60/70KB. Even if I take 100KB each, the total is just 3MB.

The project is still in development, I'm keeping these images for testing purpose. I'm not updating any new image but my byte storage keeps rising. I even deleted some images but it keeps increasing. I don't understand and I couldn't find the answer. Someone, please explain.

As you can see here in the image, the byte stored is almost 5GB. When I manually calculate all the images, it's not even 3MB.

enter image description here enter image description here

Here is the hierarchy of my cloud storage.

  1. Whenever a customer upload/update their profile picture, that image will be saved here in this "UserProfile" collection and the name of the image will be the user ID.
UserProfile (Collection)
    - user_1.jpeg
    - user_2.jpeg
    -
    -
    - user_n.jpeg
  1. Business can have many profile images. Those images will be store under "BusinessProfile\{business_id}\..."
BusinessProfile (Collection)
    - Business_1 (Sub-Collection)
        - businessImage1.jpeg
        - businessImage2.jpeg
        -
        -
        - businessImageN.jpeg
    - Business_2
    -
    -
    - Business_n
  1. A product can also have many product images. Those will be store under "ProductImage\{business_id_which_the_product_belongs}\{product_id}\..."
ProductImage (Collection)
    - Business_1  (Sub-Collection)
        - Product_1 (Sub-Collection)
            - productImage1.jpeg
            - productImage2.jpeg
            -
            -
            - productImagen.jpeg
        - Product_2
        -
        -
        - Product_N
    - Business_2
    -
    -
    - Business_3

Usually, in other people's design, they'll keep like 3 collections only to store the images and store the image URLs to the document of the user or business or product. The reason why I have this structure with sub-collections is that this way whenever I need the image in the App, I can generate the URL of the image from the ID without retrieving the document data (Just trying to optimize no. of Firebase doc reads).

Argus Waikhom
  • 186
  • 6
  • 14
  • 1
    If you are using Cloud Functions in this project too, the additional storage is most likely used by your Cloud Functions containers. See a.o. https://stackoverflow.com/questions/63778920/firebase-storage-bucket-fills-up-gradually-as-i-dont-upload-anything/63838086#63838086, https://stackoverflow.com/questions/63578581/firebase-storage-artifacts/63580047#63580047 and https://stackoverflow.com/questions/63843721/firebase-storage-artifacts-is-huge-and-keeps-increasing/63850064#63850064 – Frank van Puffelen Nov 30 '20 at 15:38
  • if you have any billing questions, you could contact billing support https://console.cloud.google.com/support – Oliver Aragon Dec 01 '20 at 15:55

0 Answers0