firebasegoogle-cloud-firestorefirebase-storage

What is the difference between Firebase Storage and Cloud Firestore/Realtime Database?


I have been using Google Firebase's Realtime Database, but want to be able to store more complex user-generated data like images, videos etc. As per the Firebase docs, they provide two other services: 'Firebase Storage' and 'Cloud Firestore'. Can someone please summarise what the difference is between the similarly named 'Storage' and 'Firestore'.


Solution

  • The products are not really comparable. They have almost nothing in common, except from the perspective of the Firebase client, apps which are gated by security rules.

    Cloud Storage is just for storing binary data using paths that look like filesystem paths. It's not a database, and you can't really query it like one. It's typically used for things like pictures, videos, PDFs, backups/exports, and other raw data which can be very large in size. There is a 5GB limit to the size of data you can store in a single object. It's dirt cheap and optimized for download speed, and can be served by CDN.

    Firestore is a database used for querying data and is almost never used for storing binary data. You use it to store actual values that you intend to query, such as names, times, and other metadata. Since a Firestore document is limited to 1MB in size, that also drastically cripples its ability to hold very large amounts of data like Cloud Storage. It's also generally more expensive to store and transfer data compared to Cloud Storage, as you're paying for much more than just basic storage capabilities.

    I suggest reading the documentation for more detailed descriptions of these products. It should be clear what specific problems they are trying to solve, as they have essentially no overlap in functionality.