Search code examples
google-cloud-platformgoogle-cloud-storagegoogle-cloud-load-balancer

Is accessing xml files in Google Cloud Storage (Bucket) an operation?


I'd like to upload some XML files to Google Cloud Storage (Bucket) and make it publicly available with an HTTPS load balancer: https://cloud.google.com/load-balancing/docs/https/ext-load-balancer-backend-buckets

The total size of these XMLs is about a GB. But I want to access the millions of time a day. And I'm not sure the cost of this. I have to pay less than a dollar for the storage, nothing for the network usage, as ingress is free, but what's about the cost of operations? So accessing my XML files through an URL, like example.com/bucket/1.xml, is a Google Cloud (Class A or Class B) operation? So I have to pay the Class A or Class B fee for several million calls? Any idea?

https://cloud.google.com/storage/pricing


Solution

  • Getting an object is a Class B Operations. The table below is found in the GCS Pricing doc.

    enter image description here

    Note the very first line storage.*.get for Class B Operations.

    These operations are just accessing an Object. When doing this, you are not listing a bucket, listing its objects or creating new objects, you are getting the object right away. This is why it is not a Class A operation.

    Related to the pricing itself, no worries: the first 50,000 Class B Operations per month are for free. After that, you get charged 0.004 USD per each 10,000 Class B Operation as shown here.

    Meaning that each 10,000,000 Class B Operations (after the first 50,000) will charge you for just 4 USD.

    You can also find the Detailed example in the docs where millions of Class A and B Operations are being performed. See how the pricing is calculated.

    Now, just to clarify you are subject to get charged for Network.

    Ingress refers to the elements that go inside GCS. In other words, uploading files to your bucket.

    NOTE. You would get charged for the Class A operation of uploading files (stroage.*.insert) but no for the network Ingress.

    When calling an object you might get charged for Egress network, which is the content that goes from the bucket to an user. The following scenarios are shown in this doc section:

    • Data moves within the same location (from US-EAST1 to US-EAST1 OR from EU to EU) will be for free.

    • Data moves between different locations on the same continent (from US-EAST1 to NORTHAMERICA-NORTHEAST1) will cost 0.01 USD per GB.

    Please find these and more examples of how and when you would get charged for Network Egress in the link above.

    Some Egress charges might also apply if the content is retrieved Worldwide and will depend on how much data was retrieved during the month.

    For instance:

    • If you send 1 TB or less during the month only to China, you would get charged 0.23 USD per GB in network Egress.

    • If you send between 1 and 10 TB only to Asia (excluding China), you would get charged 0.11 USD per GB in network Egress.

    Find in this section more information about the Network usage.

    Sorry for the long answer. I know some of the egress scenarios won't apply, I just wanted to make sure you were aware about all of the possible pricing when talking of Google Cloud Storage. Hope this is helpful! :)