TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Mobile app that works offline and syncs data periodically

4 点作者 saurabhnanda超过 10 年前
At our startup, our target market is increasingly conducting their business, on-the-go. Therefore, we have to augment our browser-based desktop app with a mobile app.<p>Therefore, I&#x27;m now evaluating what it would take to develop a mobile app that could work completely offline and sync transaction data periodically with the central server.<p>I&#x27;ve read briefly about Firebase, Parse, Usergrid, BaasBox, master-master replication, and the CAP theorem. As expected, I&#x27;m royally confused now!<p>We&#x27;ve already built out or backend using Postgres and RoR. Ideally I&#x27;d like to stick to it, especially Postgres, as we&#x27;re dealing with financial transactions. We already have HTTP&#x2F;JSON APIs to read&#x2F;write data. We can also develop fine-grained APIs using Thrift, if required.<p>Now, my question is, is there a project&#x2F;service&#x2F;SDK out there which has already solved this data sync problem? What about conflict resolution when it comes to transaction data? I understand that this is like resolving merge conflicts in git, which basically requires human intervention, but is there an SDK that will reduce dev time for such scenarios? Can said SDK work with a custom backend API?

1 comment

ProblemFactory超过 10 年前
I have been looking for tools to solve the same problem for a while now.<p>Based on documentation, the most promising approach seems to be to use Couchbase Mobile&#x2F;Lite in the app, Couchbase Server on the server, and link them up with their sync gateway: <a href="http://developer.couchbase.com/mobile/develop/guides/sync-gateway/index.html" rel="nofollow">http:&#x2F;&#x2F;developer.couchbase.com&#x2F;mobile&#x2F;develop&#x2F;guides&#x2F;sync-ga...</a><p>It seems that this should make it possible to save data both on the client and server side, and leave sync and replication to the databases themselves.<p>Now, I haven&#x27;t actually adopted it yet for two reasons:<p>* My server stack is built on top of Postgresql and Django, so I would need to either rip out Postgres and go all-in with Couchbase, or somehow sync between Postgres and Couchbase on the server, and<p>* Authentication, authorization and data access filtering has to be implemented as custom Javascript plugins in the sync gateway, so I would have to rewrite most of my server-side app logic. By default the clients have full write access to the server database...<p>But if you do give this a try, I would really like to hear about your experience.