【问题标题】:Are there billing or performance implications of multiple listeners vs single parent多个听众与单亲是否存在计费或性能影响
【发布时间】:2018-07-16 04:09:40
【问题描述】:

如果我像这样构建我的 firebase 实时数据库节点:

{
    vehicles: {
        '-vehicle-one-id': {...details },
        '-vehicle-two-id': {...details },
        ...
    }
}

观看整个存储桶与单独观看每辆车之间是否有任何良好的性能或计费原因。

例如。

db.child('vehicles').on("value", someDispatcher)

['-vehicle-one-id', '-vehicle-two-id, ...].forEach(id => 
    db.child('vehicles').child(id).on("value", someDispatcher)
)

Firebase 文档表明,如果根据规则无法访问下面的任何节点,则用户无法观看 .child('vehicles'),因此需要更精细的侦听器。

【问题讨论】:

    标签: javascript firebase firebase-realtime-database


    【解决方案1】:

    两者之间没有显着差异。如果您在侦听器中做出错误的决定,只会出现性能问题。

    【讨论】:

      猜你喜欢
      • 2019-02-05
      • 2018-04-25
      • 2016-05-19
      • 1970-01-01
      • 2013-02-17
      • 2022-10-12
      • 1970-01-01
      • 1970-01-01
      • 2010-09-22
      相关资源
      最近更新 更多