Objects and Virtual Hierarchy on the Google Cloud Platform - dummies

Objects and Virtual Hierarchy on the Google Cloud Platform

By Matthew Scarpino

Each piece of data in a Cloud Storage bucket is an object. A bucket may contain an unlimited number of objects, but each object must be 5 TB in size or less. Every object has data and metadata. When you upload a file to a bucket, the file’s content becomes the object’s data. An object’s metadata holds name-value pairs that describe the object.

The criteria for object names is much less restrictive than the criteria for bucket names:

  • An object’s name can contain any sequence of valid Unicode characters.
  • An object’s name can’t contain any Carriage Return or Line Feed characters.
  • Google recommends against using #, [, ], *, or ? in object names, as gsutil interprets these characters as wildcards.

A bucket’s name must start and end with a letter, but an object’s name can start and end with a slash (/). Therefore, you can construct a virtual hierarchy of objects by starting an object’s name with a slash.

For example, suppose that you create a bucket named gs://dummies-tfbook. You can create an object in the bucket named gs://dummies-tfbook/data and another object named gs://dummies-tfbook/data/images. Cloud Storage won’t recognize any relationship between these objects, but humans will understand that the objects form a virtual hierarchy.