How to create a Cloud Firestore database schema

Migrating from a real-time database to a cloud-based firestore requires a complete reorganization of the database. To do this, I created an example with some major design decisions. See Figure and Database Design in the table below. My two questions are:

1 - when I have a relationship from one to many, is it also the ability to store information in an array inside a document? See Line 8 for database design.

2 - Should I include only a link or duplicate all information in relation to one to many. See Line 38 in the database model.

enter image description here

https://docs.google.com/spreadsheets/d/13KtzSwR67-6TQ3V9X73HGsI2EQDG9FA8WMN9CCHKq48/edit?usp=sharing

+4
source share
1 answer

1 firestore: https://cloud.google.com/firestore/docs/solutions/arrays

"true", , :

teachers: {
        "teacherid1": true,
        "teacherid2": true,
        "teacherid3": true
    }

2 -, , , .

+1

Source: https://habr.com/ru/post/1688598/


All Articles