Firebase Storage provides an easy way to save and retrieve files in Google Cloud Storage, without needing a server.

The downside of Firebase Storage is the added 500ms of latency over using Google Cloud Storage directly.

Comparison

To compare the two services, I accessed the same file, multiple times via Firebase Storage and Cloud Storage.

The DNS, TCP, TLS, and download speeds are similar, but the Time to First Byte (TTFB) averages 549ms for Firebase Storage versus 41ms for Google Cloud Storage.

Name DNS TCP TLS TTFB Download
Firebase Storage trial 1 0.041 0.017 0.036 0.477 0.285
Firebase Storage trial 2 0.003 0.097 0.034 0.499 0.170
Firebase Storage trial 3 0.003 0.027 0.042 0.672 0.185
Firebase Storage average 0.016 0.047 0.037 0.549 0.213
Cloud Storage trial 1 0.003 0.024 0.040 0.030 0.271
Cloud Storage trial 2 0.005 0.105 0.034 0.032 0.170
Cloud Storage trial 3 0.007 0.021 0.033 0.060 0.238
Cloud Storage average 0.005 0.050 0.036 0.041 0.226

Conclusion

To improve download performance, I enabled public read-only access to the bucket used by Firebase Storage.

Instead of downloading objects from https://firebasestorage.googleapis.com/v0/b/{bucket_name}/0, I download objects from https://storage.googleapis.com/{bucket_name}.

The objects are stored using random Firebase IDs, so it’s effectively impossible to guess the URLs, but once a user has the URL of a file, they’ll have access to that file forever.