颤音:如何在后台运行远程数据库交易
我有一个电子商务应用程序。当用户添加/删除项目时,我需要将它们登录到我的远程数据库中。每笔交易都很重要,我必须确保以与发生的顺序相同的顺序记录它们。但是,它减慢了我的应用程序,往返数据库的往返时间需要时间。
我发现在本地持续进行交易将是解决延迟的好主意。使用Flutter-Hive DB,我的本地持久性效果很好,并改善了应用程序性能。
现在,我需要您的建议将这些交易发送给我的后端。代码的远程数据库侧应在后台运行,而不会使用户等待确认。任何帮助,准则或指针都将不胜感激。
I have an e-commerce app. When user add/remove items I need to have them logged into my remote database. Each transaction is important and I have to make sure that I have logged them in the same order it had happened. However it slows my app and the round trip to and from database takes time.
I found out that persisting the transactions locally would be a good idea to solve the delay.Using Flutter-Hive DB my local persistence works fine and it improved the app performance.
Now I need your recommendation for sending these transactions to my back-end as and when it happens. The remote DB side of the code should run in the background without making the user wait for the confirmation. Any help, guidelines or pointers will be highly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试 workmanager
用于定期任务,您可以使用
you can try workmanager
For periodic tasks you can use