Structuring Firebase for a large string array [duplicate] - firebase

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 )

Firebase now offers these places to store your data:
Realtime Database
Remote Config
Hosting
Storage
Cloud Firestore
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.

*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.

Related

What is the standard way to store images and data with Firebase?

We need to store user data on a database. We also need to store content/info data and images to be dynamically served to the users via a PWA.
When I tried creating the Firestore DB for the users, Firebase warned me:
"Enabling Cloud Firestore will prevent you from using Cloud Datastore with this project, notably from the associated App Engine app"
If this means that we cannot use Firestore and Storage together, what is the standard way to have a database and image content to be served to the users, with Firebase?
Cloud Datastore is not Cloud Storage. They are different Google Cloud products. If you enable Firestore, you will still be able to use Storage just fine.

How to use Cloud Firestore and Realtime Database in same project

Firebase's documentation has the following paragraph:
Using Cloud Firestore and Realtime Database: You can use both databases within the same Firebase app or project. Both NoSQL databases can store the same types of data and the client libraries work in a similar manner. Keep in mind the differences outlined above if you decide to use both databases in your app.
I can't find any documentation on how to add a Cloud Firestore to an existing project with a Realtime Database, though. I will ultimately upgrade to Cloud Firestore, but would like some time to experiment and learn before I convert the production database.
Does anybody know how to use both databases in the same Firebase project?
When you go to your project in the console and choose the Database product, you should see something like this the first time:
This is a selector that lets you choose to see either Realtime Database or Firestore in your project. You can switch between the two with this selector.
The first time you select Cloud Firestore, it will ask you to configure things. Start in "test mode" to set things up for full read and write without authentication to get started quickly, but of course your should always have rules set up in production.
After you set up Firestore, you should be able to use both client SDKs to access both databases independently.

Where to store large amounts of static data Firebase [duplicate]

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 )
Firebase now offers these places to store your data:
Realtime Database
Remote Config
Hosting
Storage
Cloud Firestore
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.
*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.

How optimize Firebase database size

I'm new with Firebase technology and I would like to optimize Firebase database size (including for decrease cost).
What are the different ways to decrease Firebase database size?
Can I simply use node names as short as possible, for example instead of having a node "user", rename this node "u"? (relevant if this node is very present)
Do there are other tips?
Here's the approach we take from one of our mobile apps:
We have a mobile app, web service, Firebase Database and Firebase Storage. We sometimes have a small SQL database as well.
We have the mobile app display data from Firebase but write data to Firebase via the web service, never directly.
We started with using Firebase Database as our storage, then changed to a hybrid Firebase Database + Firebase Storage mix.
We now store the "view data" is Firebase Storage and only store a "stub/pointer" in the Firebase Database (it reduces data size and it reduces traffic).
We end doing an extra read from Firebase Storage every time the value of a "stub/pointer" changes in Firebase Database, but that works for our scenario. We also don't do it for every situation, so we peek and chose where it makes sense to use this approach.
We ended up reducing cost - that was our main reason to search for a solution and it looks like that's your motivation as well.
Other than that, using short names for the key names may help as well.

Firebase : Differences between realtime database and file storage

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 )
Firebase now offers these places to store your data:
Realtime Database
Remote Config
Hosting
Storage
Cloud Firestore
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.
*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.

Resources