【发布时间】:2017-09-23 23:12:40
【问题描述】:
// An index to track Ada's memberships
{
"users": {
"alovelace": {
"name": "Ada Lovelace",
// Index Ada's groups in her profile
"groups": {
// the value here doesn't matter, just that the key exists
"techpioneers": true,
"womentechmakers": true
}
},
...
},
"groups": {
"techpioneers": {
"name": "Historical Tech Pioneers",
"members": {
"alovelace": true,
"ghopper": true,
"eclarke": true
}
},
...
}
}
这是双向关系的必要冗余。
如果我想使用该模型开发一个应用程序,当用户加入一个新组时,该客户端应用程序是否会向我的 Firebase 发出 2 个请求以添加 2 条记录?
如果在操作过程中出现问题。我应该怎么办?也许我需要一个定期检查数据冲突的后端服务器?
我在 Firebase 文档或有关 NoSQL 的文章中找不到有关此数据冗余问题的任何进一步说明(也许我使用了错误的关键字!)。
另外,indexing my data和上面的方法有什么区别?
【问题讨论】:
标签: firebase firebase-realtime-database nosql