> Database

1 - About

Firebase is a Cloud Databases that offer secure HTTPS-based gateway.

3 - Product

3.1 - Realtime Database

Data is saved and queried in a tree structure.

When you:

  • fetch data at a location in your database, you also retrieve all of its child nodes.
  • grant someone read or write access at a node in your database, you also grant them access to all data under that node

For a two-way relationship, the relationship needs to be duplicated (ie saved twice). The relationship is saved:

  • in the user's record
  • and under the group.

So to delete a user from the group, it has to be updated in two places. This is a necessary redundancy for two-way relationships in order to scale.



3.2 - Cloud Firestore

Cloud Firestore is a document database.

When you structure your data in Cloud Firestore, you have a few different options:

  • Documents
  • Multiple collections
  • Subcollections within documents


4 - Documentation / Reference