From 4ae599c92f499a70dbfe4b4e0b49f9d28d817a6b Mon Sep 17 00:00:00 2001 From: blur-b Date: Mon, 20 Mar 2023 17:43:42 -0400 Subject: [PATCH 1/2] added intro to cloud firestore, comparing it with realtime db, and added further readings --- .../Tech_Stacks/Intro_to_Cloud_Firestore.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Topics/Tech_Stacks/Intro_to_Cloud_Firestore.md diff --git a/Topics/Tech_Stacks/Intro_to_Cloud_Firestore.md b/Topics/Tech_Stacks/Intro_to_Cloud_Firestore.md new file mode 100644 index 000000000..d5d4d7ee2 --- /dev/null +++ b/Topics/Tech_Stacks/Intro_to_Cloud_Firestore.md @@ -0,0 +1,21 @@ +# Using Firebase's Cloud Firestore + +## Introduction + +When choosing to use a NoSQL database, Firebase provides two options. One is the Firebase Realtime Database and another is the Cloud Firestore. + +Cloud Firestore is Firebase's newest database for mobile app development. It builds on the successes of the Realtime Database with a new, more intuitive data model. Cloud Firestore also features richer, faster queries and scales further than the Realtime Database. + +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. + +## Comparing the Options + +While both are NoSQL databases, Realtime Database stores data as one large JSON tree, whereas Cloud Firestore stores data as collections of documents. This makes complex, hierarchical data harder to organize at scale in Realtime Database. In Cloud Firestore, organizing data is easier at scale using subcollections within documents. + +In addition, Realtime Database is limited in its sorting and filtering functionality. For example, queries can sort or filter on a property, but not both. These queries are also deep by default because they always return the entire subtree. In Cloud Firestore, you can chain filters and combine properties in a single query. Queries are also shallow because they only return documents in a particular collection or collection group and do not return subcollection data. + +There are many other factors to consider aside from the data models and querying, including writes and transactions, reliability and performance, scalability, security, etc. For more information, consult the [official documentation](https://firebase.google.com/docs/database/rtdb-vs-firestore). + +## Getting Started + +Once you decide to move forward with Cloud Firestore (or use it in conjunction with the Realtime Database), you can follow this [tutorial](https://firebase.google.com/docs/firestore/quickstart) to start. Further readings (e.g. how to add/manage data, make queries) can be found [here](https://firebase.google.com/docs/firestore). \ No newline at end of file From cc33aaec5b888f99753f0728f3a419ed37fefe2e Mon Sep 17 00:00:00 2001 From: blur-b Date: Mon, 20 Mar 2023 17:47:58 -0400 Subject: [PATCH 2/2] added cloud firestore link in Tech_Stacks.md --- Topics/Tech_Stacks.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Topics/Tech_Stacks.md b/Topics/Tech_Stacks.md index acf455d04..e36ebe4ef 100644 --- a/Topics/Tech_Stacks.md +++ b/Topics/Tech_Stacks.md @@ -1,3 +1,5 @@ ## Tech Stacks ### [Learning MySQL for databases](./Tech_Stacks/Learning_MySQL.md) + +### [Using Firebase's Cloud Firestore Database](./Tech_Stacks/Intro_to_Cloud_Firestore.md) \ No newline at end of file