41

I learnt about real-time data storage and hosting storage from this post Difference between Data Storage and Hosting Storage?

But i am still not clear about real time Database and and newly introduced file storage.

Does anybody have some brief explanation about it ?

Thanks in advance .

(As per the concern about duplicated with Difference between Data Storage and Hosting Storage? what the problem solves and what i am asking are two different things and hosting storage and file storage are different in case of google firebase )

Community
  • 1
  • 1
erluxman
  • 18,155
  • 20
  • 92
  • 126

2 Answers2

68

Firebase now offers these places to store your data:

The best place to store your data, depends on the type of data you want to store and the way you want to consume it.

The Firebase documentation says this about it:

  • The Firebase Realtime Database stores JSON application data, like game state or chat messages, and synchronizes changes instantly across all connected devices.

  • Firebase Remote Config stores developer-specified key-value pairs to change the behavior and appearance of your app without requiring users to download an update.

  • Firebase Hosting hosts the HTML, CSS, and JavaScript for your website as well as other developer-provided assets like graphics, fonts, and icons.

  • Firebase Storage stores files such as images, videos, and audio as well as other user-generated content.

On choosing between Cloud Firestore and the Firebase Realtime Database, the Firebase documentation says:

Firebase offers two cloud-based, client-accessible database solutions that support realtime data syncing:

Realtime Database is Firebase's original database. It's an efficient, low-latency solution for mobile apps that require synced states across clients in realtime.

Cloud Firestore is Firebase's new flagship database for mobile app development. It improves on the successes of the Realtime Database with a new, more intuitive data model. Cloud Firestore also features richer, faster queries and scales better than the Realtime Database.

Community
  • 1
  • 1
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 5
    Is it possible to add reference to a child to an image? For example, the user "mchen" has a profile picture, and that picture is stored in Storage? – Ali Bdeir Jul 10 '16 at 14:28
  • 1
    If I'm not mistaken @AbAppletic, when uploading to storage, you write the files path to the relevant node in the realtime database, and then use that to get the image with the storage API. – Brad Adams Oct 24 '16 at 13:35
  • @BradAdams true. But that is rather data-taking. It's sad that Firebase doesn't have this feature. Just sad – Ali Bdeir Oct 24 '16 at 16:45
  • @AbAppletic sure is... Funnily enough I've had to tackle a similar issue today and ended up coming to SO for help (http://stackoverflow.com/questions/40221719/load-and-return-an-image-from-firebase-database-storage-in-react-native). This would be resolved if the URL in the database was the direct URL to file, but I get the feeling **that** URL isn't _solid_ (like it could update at a later date or something...) – Brad Adams Oct 24 '16 at 16:50
  • Still not understand what difference between `Firebase Hosting` and `Firebase Storage`. Hosting can also serve images, videos, and audio, can't it? – Thaina Yu Jan 05 '17 at 04:31
  • 1
    Yes. The difference in who creates the content: Hosting doesn't have a public API for uploading, so is mostly useful for content you create as part of the application. For content that your users generate, Storage is a better fit. – Frank van Puffelen Jan 05 '17 at 05:21
  • @FrankvanPuffelen Hello, I need to host some pictures that users can view in my app (Android only). These pictures will be shown in a list. This is not user generated content, but pictures I will manually upload to Firebase. These pictures will probably not change in the future. Is it best to use Firebase Storage or is there another way? I looked into Firebase Storage but not sure what's the best way to implement this. Do I need to create a file in the Realtime Database that contains the URL of the files? Thanks, Thomas – Thomas Vos May 06 '17 at 16:15
  • @FrankvanPuffelen But In firebase console -> Realtime Database section says "Cloud Filestore(BETA) The next generation of the Realtime Database with more powerful queries and automatic scaling." So whats new in Cloud FileStore related to realtime DB? – Shebin Koshy Oct 07 '17 at 16:41
  • "...with more powerful queries and automatic scaling" – Frank van Puffelen Oct 07 '17 at 16:42
8

*Realtime database store data only json format and it is specially used in app where data is synchronized concurrently like ola app(user location),sensex(Nifty) app where data not persist .

*Firebase Storage just only store data like memory card.It is specially used for store backend data of app.