使用Firebase显示报告的最佳方法是什么? [英] What is the best way to show reports with firebase?

本文介绍了使用Firebase显示报告的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Cloud Functions在Firebase中进行聚合,以便每当发生某种类型的数据输入时,我都会进行相应的聚合并将其存储以显示我们的报告.这种方法存在以下问题:-

I am currently using Cloud Functions to do aggregation in Firebase so that whenever a certain type of data entry occurs, I aggregate it accordingly and store it to show our reports. There are following concerns with this approach:-

  1. 添加新报告意味着要遍历所有现有数据,而对于Firebase实时数据库而言这可能会很昂贵
  2. 对现有报告进行任何更改也是不容易的

我当时正在考虑像Cloud Dataflow这样的解决方案.但是,一个问题是,它不属于Firebase的Spark或Flame计划.

I was considering a solution like Cloud Dataflow. However, one issue is that it is not part of the Spark or Flame plan of Firebase.

使用Firebase处理报表并同时兼顾成本和性能的最佳方法是什么?

推荐答案

在Stack Overflow上,不建议使用特定的报告解决方案.

Recommending a specific reporting solution is off-topic on Stack Overflow.

但是一般而言,我建议您将活动数据(用户需要直接访问)与历史数据(您主要用于报告)分开.将您的活动数据保存在Firebase数据库中,该数据库已针对在用户之间同步数据进行了优化.然后,将历史数据保存在针对报告进行了优化的单独数据存储中.

But in general I recommend separating your active data (that users need to access directly) from your historical data (that you keep mostly for reporting). Keep your active data in your Firebase Database, which is optimized for synchronizing data between users. Then keep your historical data in a separate data store that is optimized for reporting.

一种很常见的组合是将历史数据保留在BigQuery中,然后在那儿汇总数据.然后,您可以将聚合数据写回到Firebase数据库,以供用户使用.

A quite common combination is to keep the historical data in BigQuery and then aggregate the data there. You can then write the aggregated data back to your Firebase Database, to make it available to your users.

这篇关于使用Firebase显示报告的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆