Google Firebase Cloud Storage high bandwidth cost - firebase

The problem I'm experiencing is high cost of bandwidth usage on a multi regional us bucket. Can anyone explain what this cost corresponds to? This Firebase Storage service is used for hosting asset files therefore the only operation that is required by the end user is downloading.
Additionally cost for Upload ops/Download ops/Bytes stored are practically non existent from what I see in Firebase Console.
Thanks

The main reason for a higher cost was that I had my assets stored in an additional bucket that I've created aside of the default one. As it turns out when you're utilizing additional buckets the different pricing schema is applied. Brief information in this regards can be found in Firebase pricing page under ? icon corresponding to Firebase Storage entry.
This is the estimated pricing for common usage. Firebase Storage free
limits are enforced daily and refreshed at midnight Pacific Time. In
the Blaze plan, fees for Firebase Storage are based on usage volume.
Firebase Storage usage fees are processed as Google Cloud App Engine
usage fees for the default bucket, and Google Cloud Storage usage fees
for any additional buckets. For more information, see pricing for
Google Cloud App Engine and Storage.
Additionally, prior to my current implementation of assets cloud fetching, I had it done via publicly accessible HTTP protocol (there are many Youtube clips which "teach" this approach). I'm not quite sure but that might've had an impact on a pricing schema as well (it's a little bit too convoluted reading Google's documentation in this regards and understanding all the terminology). On top of that this approach presented security threat as the urls were publicly accessible to anyone - in order to prevent it one should always think of some kind of authorization mechanism.

Related

Using Firebase .getDownloadURL() Is the image display charged?

I'm using Firebase on Flutter, and I have a question.
I use the .getDownloadURL() function to get the URL of the image uploaded to the FireStore and display the image in the app as a NetworkImage(url) function.
At this time, will the firebase cost be charged?
Summary:
flutter > .getDownloadURL() > NetworkImage(url)
I'd like to know if the cost will be incurred at this time.
Please check.
Yes, beyond the free plan, downloading data from Cloud Storage through Firebase is a charged operation.
As shown in the Firebase pricing, you will be charged for the number of download operations, and for the amount of data downloaded.
Firebase has two pricing levels. The first one incorporates a limited Free tier, and it’s an excellent option for development and small applications. The second tier works on a pay as you grow model, and it’s ideal for production applications. Hopefully this will help you.
Spark Plan (Firebase free tier) is a basic plan offering 1 GB total storage, 20K writes/day, 50K reads/day, and 20K deleted/day
Blaze Plan (paid) is a pay as you go plan charging $0.18/GB for database storage, $0.026/GB for application storage, and additional charges for database operations, data transfer, etc.

Does firebase storage charges only for storage or for showing image as well?

Could someone please clarify. If I use only Firebase Storage and save images there and show that images in my app by providing the URL of the image. Will I be charged only for amount of memory I use OR I will have to pay for users that look at those images in their app as well? If so that means as more traffic I have in my app with that images more money I will have to pay?
The Firebase pricing can be found here:
https://firebase.google.com/pricing
The delivery of content from Firebase Storage is indeed a chargeable concept. I believe that as of 2021-10, the first GB/day is free with $0.12/GB after that. You are also charged for actual requests ... the first 50K/day are free with a charge of $0.004/10K after that.

understanding "action required" email from GCP, re: enable Cloud Build API

I use Firebase for my web apps, not Google Cloud Platform -- though I'm aware that behind the scenes, every Firebase project is also a GCP project.
I just received an email from GCP, saying (excerpted):
[Action required]: Enable the Cloud Build API for your projects before April 20, 2020, to ensure Cloud Function is built and deployed correctly ... You must enable the Cloud Build API for your project(s) to ensure your Cloud Function is built and deployed correctly. Once you enable the API, you may incur charges if your Cloud Build, Container Registry, or Cloud Storage usage exceeds the free tier limits for these products.
Does this impact the deployment or development process for Firebase at all? (e.g., right now I use firebase deploy )
As far as I can tell, the answer is no -- it just allows for a greater maximum build-time-per-day. But the email didn't mention Firebase at all, so I want to be sure I understand any other implications well before April 20.
I had the same questions and got in touch with the firebase support team, here are my questions and the answers I received:
"Is that mandatory?"
Only if you are going to deploy Cloud Functions in the future, already
deployed functions will not be affected.
"How do I know if my Cloud Build, Container Registry, or Cloud Storage usage will exceed the free tier limits for these products? is there any way how can check what I've been using so I'll be prepared?"
Cloud Build provides a free tier where only usage above 120
build-minutes/day will be charged. When your usage is within the free
tier, you will not be charged for the Cloud Build portion of Cloud
Function deployments. See Cloud Build pricing for more information.
Similarly, Cloud Storage and Container Registry share a free tier
where only usage above 5GB-months will be charged. ( * Note : free
tier only limited to US regions - US-WEST1, US-CENTRAL1, and US-EAST1
and aggregated over all 3 regions )? For example, if you have a large
deployment that uses 100GB of storage, you will only be charged an
additional $2.47 for storage/month (based on these particular U.S.
regional storage prices). You can monitor your usage and see whether
you are getting close to hitting the free quotas.
"Lastly, what does all this stuff do for my app? Why do I need to add this other features? If you were to sell me this, how would you present it for my use-case?"
This is a best effort from Google to communicate information that is
necessary to the user’s continued use of the product or that is
considered a necessary legal update and keep customers away from
having future issues. Using Cloud Build, Container Registry and Cloud
Storage provides the following benefits: Detailed function build logs
will be available in the GCP Console, aiding in debugging and
increasing visibility. The ability to get build time that exceeds the
current build quota of 120 build-mins/day. The ability to view a built
container image for your function in Container Registry.
I received the following response from Firebase Support:
You will not be able to use cloud functions if you do not enable the Cloud Build API after this date [April 20, 2020].
And, in a follow-up exchange:
as far as I know in terms of deployment everything will be the same
So, my interpretation of those responses with respect to the original question (will this affect the mechanics of development or deployment) is:
Deployment process: no change necessary
Development process: no change necessary*
*if your build time exceeds 120 minutes per day, and you wish to avoid associated charges, you could voluntarily investigate changing your deployment/development process to reduce build minutes.
Thanks also to Fran for his answer, which sheds light on other aspects of the change.

Firebase Ecosystem - Security and Cost

In the Firebase ecosystem, for example in Cloud-Firestore, financial cost is highly dependent on factors such as document reads.
Is there anything protecting us from hostiles sending large numbers of read requests directly to our Firestore (circumventing our app) in order to drive our cost up?
Does the Firebase platform somehow recognise this and filter it out, or would we simply have to pay if this happened to us?
Clarification: Let's assume our Firestore security rules are such, that there are certain read requests which can be performed by anyone (allow read;). Consider for example a HackerNews type application, where anyone can list posts (no authentication required).
Cloud Firestore is designed to enable you to scale without experiencing an outage due to overload. We do enable you to set daily spending caps using the App Engine daily spending limit which can help prevent unexpected runaway costs.
There are a few other strategies to help control for this as well, such as using Firebase Auth and requiring users to sign-in, or doing server-side rendering of read-only results.

Is Firebase Blaze storage and database pricing billed as full GB (downloaded + stored)?

Everything here https://firebase.google.com/pricing/ that says "/GB" in Blaze plan, if I have less than GB will the price be calculated lower (like Amazon Web Service's) or billed as full GB?
Want to move from AWS but my app has rather small database/storage but requires large amount of access that it exceeded Spark plan. It would be a shame if Firebase bill me full $5 for realtime database that have barely anything. (In that case stick with AWS might be better)
I know this should go to their support but unfortunately this page https://firebase.google.com/support/ told me to come here, and their direct support is capped at 5 times per year..
Prorated. Calculated lower.
Storage charges are prorated on a per-object basis
https://cloud.google.com/storage/pricing
(referenced as "2) This is the estimated pricing for common usage. Firebase Storage free limits are enforced daily and refreshed at midnight Pacific Time. In the Blaze plan, fees for Firebase Storage are based on usage volume. Firebase Storage usage fees are processed as Google Cloud Storage usage fees. For more information, see Google Cloud Storage Pricing." in the fine print)

Resources