小编iCo*_*101的帖子

Cloud Firestore-确保数据一致性

我的数据库使用冗余数据来加快获取速度,并最大程度地减少某些查询需要读取的文档数量。例如,我会将关注的用户的名称存储在用户文档中的地图中,因此我不必阅读其他文档即可检索每个关注的用户的名称。

User: (Collection) {
    userID: (Document) {

    //user state
    name: ...

    followingUsers: (Map) {
        followingUserID: nameOfUser,
        followingUserID: nameOfUser
    }
}
Run Code Online (Sandbox Code Playgroud)

}

如果用户要更改其名称,那么将这些更改与冗余数据一起传播到所有位置的最佳方法是什么?

firebase google-cloud-firestore

5
推荐指数
1
解决办法
1109
查看次数

标签 统计

firebase ×1

google-cloud-firestore ×1