将数据发送到Firestore很慢 [英] Sending data to firestore is slow

查看:50
本文介绍了将数据发送到Firestore很慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们计划做一个实时应用程序,我们能够将Firestore集成到应用程序中,但是使用用于Firestore的官方flutter插件将数据发送到Firestore平均需要1.2秒.即使在良好的Internet连接中,速度也不一致.我们还使用了plugin(cloud_firestore)随附的示例应用程序对此进行了检查.我们已经在所附工作表中记录了一些示例( https://docs.google.com/spreadsheets/d/1oJBTTbF8654EiFy5whMztWLBSQ8mViRIuE2TLK_ThzA/edit#gid=0 )

We are planning to do a realtime application, We are able to integrate firestore in the app, but, sending data to firestore takes an average of 1.2 seconds using the official flutter plugin for firestore. The speed is not consistent even in good internet connection. We have also checked this with the example app provided with the plugin(cloud_firestore). We have recorded some samples in the sheet attached (https://docs.google.com/spreadsheets/d/1oJBTTbF8654EiFy5whMztWLBSQ8mViRIuE2TLK_ThzA/edit#gid=0)

我已发送此数据以记录样本.

I have sent this data to record the samples .

 {
      'sentTime': DateTime.now(),
      'serverReceivedTime': FieldValue.serverTimestamp(),
 }

我们正在构建一个速度非常重要的应用程序.速度必须至少小于100毫秒才能在Firestore端接收数据.数据将非常小,就像创建一个小的文档一样.

We are building an app where speed is very important.The speed has to be less than at least 100 milliseconds for the data to be received at the firestore end. The data will be very small, like creating a small document.

请帮助我们提高速度.如果您对问题或所附文件有任何疑问,请发表评论.

Please help us to improve the speed. Please comment if you have any doubts with the question or the document attached.

预先感谢

推荐答案

如果您打算快速(相对)较小的写入操作进行快速同步,请考虑使用Firebase的Cloud Firestore实时数据库.

If you are aiming for fast synchronization of (frequent) relatively small write operations, consider using Firebase's Realtime Database over Cloud Firestore.

Firebase有两个NoSQL数据库:Cloud Firestore和实时数据库.这两个数据库均提供实时同步作为其核心原语之一,但是Realtime Database通常速度更快,并且可以更有效地处理小型写入操作(并且通常更便宜),而Firestore是最好的,如果您有相对较大的文档,则数量较大(50K-1M并发)侦听器,并且写操作相对较少.

Firebase has two NoSQL databases: Cloud Firestore and the Realtime Database. Both database's offer realtime synchronization as one of their core primitives, but Realtime Database is often faster and handles small write operations more efficiently (and often cheaper), while Firestore is best if you have relatively big documents, a larger number of (50K-1M concurrent) listeners, and relatively fewer write operations.

这篇关于将数据发送到Firestore很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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