哪些Android数据库解决方案最适合与在线和仅离线用户一起使用?

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

Which Android database solutions are best for working with both online and offline-only users?

问题

我计划制作一个冥想日志应用程序,可以将所有用户的数据离线存储在用户的设备上,但也提供将这些数据同步到云端的选项。

Firebase并不是一个很好的解决方案,因为它通常期望设备将云端作为主要数据源进行同步。

什么是最好的数据库解决方案,可以完全离线工作,但也可以轻松同步到云端,以便在多台设备之间共享数据?为了进一步缩小范围,最便宜的选项也更可取。

英文:

I plan to make a meditation journal app which stores all the user's data offline on the user's device, but also offers an option to sync this data to the cloud.

Firebase isn't really a good solution for this as it generally expects that the device will sync to the cloud as its primary source of data.

What is the best database solution which works 100% offline, but which can also be easily synced to the cloud to share the data across multiple devices? To narrow it down further, the cheapest option would also be preferred.

答案1

得分: 1

你可以在离线时使用 Sqlite 链接,在在线时使用 SqlServer,当用户离线时使用 Sqlite,当在线时使用 SqlServer,只需在在线时进行同步,但你需要一种良好的方式来管理两侧或两种情况下的结构化数据,参见 链接

英文:

You can use Sqlite link for offline and SqlServer for online, when the user is offline use Sqlite and online SqlServer, just synchronize it when is online, but you need a good way to manage structured data in both sides or cases, see the link.

答案2

得分: 0

使用Kotlin协程与Room数据库,这样你可以异步调用查询,而且更容易使用。

更多信息请查看:
https://amitshekhar.me/blog/room-database-with-kotlin-coroutines

英文:

use Room DB with kotlin coroutines, so you can call queries asyncronously.
and it is more easy to use

for more:
https://amitshekhar.me/blog/room-database-with-kotlin-coroutines

huangapple
  • 本文由 发表于 2023年6月9日 03:45:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76435235.html
匿名

发表评论

匿名网友

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

确定