Skip to content

Added intro to Firebase's Cloud Firestore database in Tech Stack #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Topics/Tech_Stacks.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
## Tech Stacks

### [Learning MySQL for databases](./Tech_Stacks/Learning_MySQL.md)

### [Using Firebase's Cloud Firestore Database](./Tech_Stacks/Intro_to_Cloud_Firestore.md)

### [Postman API Testing](./Tech_Stacks/Postman_Backend_Testing.md)
### [Nuxt3](./Tech_Stacks/Nuxt3.md)

### [Building Apple Native Software Using Swift and SwiftUI](./Tech_Stacks/swift.md)

### [How to access and use salesforce API](./Tech_Stacks/salesforce_api.md)
### [React Resources](./Tech_Stacks/React.md)
### [Angular Resources](./Tech_Stacks/Angular.md)
Expand Down
21 changes: 21 additions & 0 deletions Topics/Tech_Stacks/Intro_to_Cloud_Firestore.md
Original file line number Diff line number Diff line change
@@ -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).