May 17, 2023
ColdFusion 2023 – Google Cloud Platform – Storage
May 17, 2023
ColdFusion 2023 – Google Cloud Platform – Storage
ColdFusion developer for 20+ years, professional experience in 10 other languages & frameworks. Artist, nerd, Jeep enthusiast.
Newbie 35 posts
Followers: 26 people

Google Cloud Storage is a scalable, fully-managed, secure, and highly available object/blob storage service from Google Cloud. It’s designed to handle data from any source and can serve data to any destination.

You can do just about anything with it that requires storing and accessing files and data, but here are a few potential use cases:

Backup and Archival: Google Cloud Storage can be used to store backups of your data, whether it’s from your on-premises servers or from other cloud services. This is particularly useful in disaster recovery scenarios. You can also use it for archival storage, such as keeping historical data that you don’t need to access frequently but can’t delete due to compliance or business requirements.

Data Analytics: Google Cloud Storage can serve as a data lake where you dump various kinds of data from different sources. You can then run big data analytics jobs on this data using other Google Cloud services like BigQuery, Dataflow, or Dataproc.

Machine Learning and AI: Large datasets for machine learning and AI models can be stored in Google Cloud Storage. It integrates well with Google’s AI Platform and other ML/AI services, allowing you to train models directly on data stored in Cloud Storage.

Serving Website Content: Static files for websites such as HTML, CSS, JavaScript, and media files can be hosted on Google Cloud Storage. It integrates with Google’s global network, ensuring low latency and high transfer speeds to end users around the world.

Data Transfer: Google Cloud Storage can be used as an intermediary for transferring large amounts of data. This can be particularly useful when migrating data to the cloud, moving data between cloud regions, or exchanging data with partners or customers.

Media and Content Delivery: For streaming video or delivering other media content, Google Cloud Storage can be used as the origin server in conjunction with a content delivery network (CDN).

IoT Data Storage: Data from IoT devices can be stored and analyzed using Google Cloud Storage. The data can then be used to provide real-time insights or fed into machine learning models.

Building Serverless Applications: As part of a serverless application, Google Cloud Storage can be used to trigger Cloud Functions when new files are uploaded. This can be useful for performing operations like image or video processing, data validation, or transformation.

In ColdFusion 2023 we are adding the ability to access and use Google Cloud Platform Storage natively, right in your code. As with the other GCP services, you will need a GCP account and project, in this case with Storage enabled, as well as creating credentials for a service account.

Once you have things set up both on the GCP and in your local system, you can start working with Storage. In GCP storage you have the concept of “Buckets”, which are containers that hold “Objects”, which are files such as images, zips, etc. This is analogous to AWS S3 and Azure Blob storage paradigms.

Using your credential object, you can now work inside Storage using CFML. For example, if you wanted to create a Bucket, you could use the following code:

storageObj = getCloudService(application.gcpCred, application.gcpConf);
bucketInfo = {
“name” : “BUCKETNAME”,
“storageClass” : “STANDARD”,
“location” : “us-east1”
bucketObj = storageObj.createBucket(bucketInfo);

This CFScript will create a bucket called “BUCKETNAME” with the STANDARD storage class, in US East 1 region, then dump back the bucket object and its metadata.

For more details about all of the methods available for interacting with GCP Storage, please see our detailed documentation here:


Add Comment