Storage

"firebase/storage"
"firebase-admin/storage"

Google Cloud Storage

Firebase Storage is a wrapper around Google Cloud Storage, which is a cloud storage service similar to Amazon S3.

It is an object storage service because it stores objects in a bucket.

A firebase project is given a default bucket.

objects in a bucket

we use the term object instead of file to emphasize some differences:

  • objects are immutable. We may not edit and save an object. We must create a new, distinct object. This is distinct from files that are writable and may change over time. We may overwrite an object with an object of the same name. In that case, we may describe it as a new generation.
  • objects live in a single, flat container, whereas files usually live in a vertical hierarchy of directories. The flat layout allows to split up objects on different machines, which makes it easier for provider to accommodate large storage needs.
  • the flat container is called a bucket. Within a bucket, we may emulate a hierarchy by adding subpaths to file names such as public/ in public/abc.png

default's bucket's identifier and URI.

The bucket's name or identifier is a domain that uses the project's name, such as projectname.firebasestorage.app. It is unique because the project's name itself is (globally) unique.

projectname.firebasestorage.app
imgtale.firebasestorage.app
projectname.appspot.com # old domain name

the extended name or identifier is a fully-fledged URI, and uses the gs:// prefix.

gs://imgtale.firebasestorage.app

We may not query the domain name or the URI as-is, as it only serves as an identifier: the bucket is not accessible in this way.

specify a bucket

The client SDK picks the default bucket by default.

If we are to use a distinct bucket, we must provide its URI.

const storage = getStorage(app, bucketURI)
const storage = getStorage(app, "gs://...")
earlymorning logo

© 2025 - All rights reserved

Storage

"firebase/storage"
"firebase-admin/storage"

Google Cloud Storage

Firebase Storage is a wrapper around Google Cloud Storage, which is a cloud storage service similar to Amazon S3.

It is an object storage service because it stores objects in a bucket.

A firebase project is given a default bucket.

objects in a bucket

we use the term object instead of file to emphasize some differences:

  • objects are immutable. We may not edit and save an object. We must create a new, distinct object. This is distinct from files that are writable and may change over time. We may overwrite an object with an object of the same name. In that case, we may describe it as a new generation.
  • objects live in a single, flat container, whereas files usually live in a vertical hierarchy of directories. The flat layout allows to split up objects on different machines, which makes it easier for provider to accommodate large storage needs.
  • the flat container is called a bucket. Within a bucket, we may emulate a hierarchy by adding subpaths to file names such as public/ in public/abc.png

default's bucket's identifier and URI.

The bucket's name or identifier is a domain that uses the project's name, such as projectname.firebasestorage.app. It is unique because the project's name itself is (globally) unique.

projectname.firebasestorage.app
imgtale.firebasestorage.app
projectname.appspot.com # old domain name

the extended name or identifier is a fully-fledged URI, and uses the gs:// prefix.

gs://imgtale.firebasestorage.app

We may not query the domain name or the URI as-is, as it only serves as an identifier: the bucket is not accessible in this way.

specify a bucket

The client SDK picks the default bucket by default.

If we are to use a distinct bucket, we must provide its URI.

const storage = getStorage(app, bucketURI)
const storage = getStorage(app, "gs://...")