移动应用的后台数据同步 [英] Background data sync for mobile apps

查看:57
本文介绍了移动应用的后台数据同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在数据库之上构建 API 和移动应用程序,该数据库在感兴趣的主表中有几十万条记录.

We're building an API and mobile app on top of a database that has a few hundred thousand records in the main table of interest.

我们的移动开发人员正在努力将应用预加载到本地数据库中的完整表中,然后提供一项服务,手机可以根据 updated_at 列同步更改.

Our mobile developer is pushing hard about pre-loading the app with the full table in a local db, then having a service which the phone can sync changes against an updated_at column.

虽然通过搜索本地商店肯定可以提高应用程序的性能,但我担心随着我们获得更多客户,这会在服务器上造成大量负载.

While this can definitely increase performance of the app by having it search a local store, I'm worried this will create a lot of load on the server as we acquire more customers.

有没有其他人处理过这个问题?这是个好主意还是坏主意?你能分享一些见解和链接吗?

Has anyone else dealt with this? Is it a good idea, bad idea? Can you share some insights and links?

推荐答案

免责声明:我自 2008 年以来一直致力于开源同步数据库,所以我对解决方案空间有偏见.

Disclaimer: I've been working on open-source sync databases since 2008, so I am biased about the solution space.

首先,不要一开始就认为您要跟踪表中的 updated_at 列,沿着这条路走下去是疯狂的. 专门的专业工程师团队通常需要数年时间来构建同步解决方案,而这些解决方案并不像一堆黑客.

First, don't start out thinking you are going to track updated_at columns on a table, down that path lies madness. Teams of dedicated specialized engineers routinely take years to build sync solutions that don't feel like a pile of hacks.

我的团队一直在构建轻量级嵌入式数据库,让您可以存储本地 JSON 并与之交互来自原生 iOS、Android、.NET 或 JavaScript 代码的对象.数据库 API 都是本地的,所以您可以查询、读取和写入,而无需担心您的网络链接状态.对于开发人员来说,网络连接成为您一次配置的东西,而不是您每次需要数据时都要处理的东西.

My team has been building a lightweight embedded database that allows you to store and interact with local JSON objects from native iOS, Android, .NET, or JavaScript code. The database API is all local so you can query, read, and write, without worrying about your network link status. For a developer, the network connection becomes something you configure once, instead of something you deal with every time you need data.

我们还构建了一个服务器,这使得构建应用程序变得容易不同类型的数据流.您的应用程序的服务器端可以像一个简短的 JavaScript 同步函数(基于 map reduce)一样简单,它可以将数据路由到频道(并授予用户或组的频道访问权限).您还可以通过渠道推动后端流程 因此用户操作会触发现实世界的事件,例如发送推送通知或更新现有的后端 API.

We've also built a server to go with it, that makes it easy to build apps with different kinds of data flows. Your app's server side can end up as simple as a short JavaScript sync function (based on map reduce) which can route data to channels (and grant channel access to users or groups). You can also drive backend processes via channels so user actions trigger real world events like sending a push notification or updating an existing backend API.

如果您觉得其中任何一个有趣,我们有一个活跃的用户和贡献者社区在我们的邮件列表中.我们所做的一切都是开源的,而且由于我们使用开源协议,因此有一个 我们可以同步的其他项目的生态系统.

If any of this sounds interesting to you we have an active user and contributor community on our mailing list. Everything we do is open source, and since we use open source protocols, there is a wide ecosystem of other projects we can sync with.

这篇关于移动应用的后台数据同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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