应该使用Firestore + HiveDB还是仅使用具备离线支持的Firestore。

huangapple go评论54阅读模式
英文:

Should use Firestore + HiveDB or only Firestore with offline support

问题

我是Flutter移动开发的新手。
我的应用程序需要从服务器实时更新到设备的数据,但数据每天必须更改几次,所以我想为它应用本地缓存。
我正在考虑两个选项。
第一,使用Firebase Firestore进行实时更新,每当服务器更新数据时,保存在Firestore上的设备将得到更新并存储在HiveDB中。这意味着Firestore看起来像服务器发送事件。我认为这个选项延迟较低,速度快,节省成本。
第二个选项将仅使用Firestore的离线兼容模式,但我对这个选项不太了解。

对于任何更新,我将调用API将数据发送到服务器,不允许直接将数据写入Firestore(CQRS模式)。

对于这种情况,您有什么建议吗?非常感谢。

我应该选择哪一个?还有其他替代方案吗?

英文:

I'm a newbie in mobile development with Flutter.
My application requires real-time updates from the server to devices, however, the data must be changed a few times per day then I want to apply local caching for it.
I’m considering 2 options.
First, using Firebase Firestore with a real-time update then anytime the server updates data, saving on Firestore devices will get updated and stored in HiveDB. It means Firestone looks like servers send events. I think this one has less latency, is fast, and saves cost.
The second option will use only Firestore with offline compatibility mode, but i don't know so many details about this option.

For any update I will call APIs to the server not allowing to write data to firestore directly (CQRS pattern).

Any suggestions for me for this case. Thank you a lots.

Which one should i go? Or any alternative options?

答案1

得分: 1

Firestore + HiveDB
Advantages: 实时更新,离线支持,快速访问。
Considerations: 数据一致性,复杂性。

Firestore with offline compatibility mode
Advantages: 实时更新,离线支持,简化实现。
Considerations: 有限的离线功能,网络依赖性。

最终选择应基于您的需求以及数据一致性、复杂性、离线功能和网络依赖性等因素。

英文:

<p style="margin: 0;"><strong>Firestore + HiveDB</strong><br /><br />Advantages: Real-time updates, offline support, fast access.<br />Considerations: Data consistency, complexity.<br /><br /><strong>Firestore with offline compatibility mode</strong><br /><br />Advantages: Real-time updates, offline support, simplified implementation.<br />Considerations: Limited offline capabilities, network dependencies.<br /><br />Choose ultimately based on your needs and factors like data consistency, complexity, offline functionality, and network dependencies.</p>

huangapple
  • 本文由 发表于 2023年5月22日 23:37:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76307824.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定