Google Cloud Storage (GCS) is a great way for applications to manage their unstructured data at a very low cost. Applications can utilize GCS APIs to integrate or share a direct GCS URL to upload or download data files. GCS also has the ability to upload data in multiple parts/chunks using resumable uploads.

Fail-proof uploads to Google Cloud Storage

The benefits of a resumable upload vs. a single upload is that applications can be resilient to network availability, as they can upload parts of data when the network is available and then pause when the network suddenly becomes unavailable. As a result, you can also reduce your bandwidth costs because you won’t have to restart large file uploads from the beginning.

One example can be when uploading photos or documents from a mobile app to the server over WiFi only; the mobile app can automatically pause the upload when the device is on cellular data and resume once back on WiFi.

GCS buckets provide an endpoint URL to make API calls as follows:

It is always recommended to hide the implementation details and tools being used from the end-users in a software application. The same principle will be applicable for GCS buckets within our application and recommendation will utilize custom URL for exposing GCS buckets.

For accessing GCS buckets via custom URLs such as https://mydrive.<your-company-domain-name>.com, Google provides a configurable “Backend Bucket” service via a GCP load balancer and detailed steps are outlined below.

Steps to Connect Backend Bucket to a GCS Bucket

Login to the GCP console and select Network Services -> Load Balancing from the left-hand navigation bar.

2. Click on “Create Load Balancer”.

3. Select “HTTP(S) Load Balancing” and click on “Start Configuration”.

4. Select “From Internet to my VMs” as internet clients will be interacting with the bucket.

5. Provide a name to your load balancer and select your Backend configuration as Backend buckets

6. Provide a name for your backend bucket and select a Cloud Storage bucket to interact with this backend service. In my case: GCS bucket is publicly open to reduce the complexity of retrieving and passing authorization token in API calls.

7. Once the Backend bucket is successfully created, we should see a list of Backend buckets.

8. Frontend configuration connects the static IP address to the load balancer for our services to interact with the GCS bucket.

9. Review and finalize the configuration.

10. We should have a Backend bucket service created successfully as below.