0
votes

Edit: After posting the question I thought I could also make this post a quick reference for those of you needs a quick peek at some of the differences between these two technologies which might help you decide on one of them eventually. I will be editing this question and adding more info as I learn more.

I have decided to use firebase for the backend of my project. For firestore is says "the next generation of the realtime database". Now I am trying to decide which way to go. Realtime database or cloud firestore?

Billing:

At a first glance, it looks like firestore charges per number of results returned, number of reads, number of writes/updates etc. Real-time database charges based on the data transmitted. The number of read-write operations is irrelevant. They both also charge on the data stored on the google servers too (I think in this respect firestore is cheaper one). Why am I mentioning this price point? Because from my point of view, although it might a lower weight, it is also a point to consider while choosing the one over the other.

Scaling:

Cloudstore seems to scale horizontally seamlessly. I think this is not possible with the real-time database.

Edit: In the real-time database, you need to shard your data yourself using multiple databases. And you can only do this if you are in BLAZE pracing plan. ref: https://firebase.google.com/docs/database/usage/sharding

Performance & Indexing:

Another thing is the real-time database data structure is different in both. The real-time database stores the data as a JSON object in any way we structure them. Firestore structures the data as collections and documents. And hence the querying also changes between the two.

I think firestore does auto indexing which increases the read performance greatly too (which will decrease read performance). I am not sure if this is also the case with the real-time database.

Edit: The real-time database does not automatically index your data. You need to do it yourself after a solid inspection of your data and your needs. ref:https://firebase.google.com/docs/database/security/indexing-data

What other differences can you think of?

What would be (or has been) your choice for different types of projects?

Do you still go with the real-time database or have you migrated from that to the firestore? If so why?

And one last thing. How would you compare the SDKs of these two?

Thanks a lot!

1
Check the official documentation regarding the difference between Firebase realtime database and Cloud Firestore and the Firebase blog post regarding the same topic. - Alex Mamo

1 Answers

0
votes

What other differences can you think of?

what i think, ok. I use realtime-database for 6 months experience and difference is, firestore easy for sorting data. As Example, i want to retrieving user name based timestamp.

Query firstQuery = firestore.collection("Names").orderBy("timestamp", Query.Direction.DESCENDING).limit(10); // load 10 names

What would be (or has been) your choice for different types of projects?

For me, Realtime-Database for Data Streaming when i work with Arduino, i want to store Drone Speed.

And Firestore for SMART OFFICE, like Air Conditioner, or light-room and Enterprise like Inventory Quantities, etc.

Do you still go with the real-time database or have you migrated from that to the firestore? If so why?

still go with real-time because i need TREE for displaying streaming data strucure instead of query TABLE like firestore.