使用Firebase DB和本地数据库 [英] Use Firebase DB with local DB
问题描述
在我的应用程序中,我有 SQLite db
。我想介绍我的用户设备之间的同步。 Firebase DB
看起来是一个可接受的解决方案,但是 Firebase DB
首先是云数据库。所以,我不能使用它作为本地数据库,如果用户将拒绝auth对话框,让他使用的应用程序,但没有云同步。
现在我想结合我的本地SQLite数据库
与云Firebase数据库
。
例如,当用户向本地SQLite数据库
添加新行时,我的应用程序也会将数据放入 Firebase DB
中。此用户的其他设备将捕获此事件并更新其本地数据库。当用户使用认证并在新设备上安装应用程序时,我希望它下载所有行,并将它们放到本地SQLite数据库
中。这是我的想法:只使用 Firebase DB
来同步数据,而不是将其存储在设备上。主要的原因是让用户使用我的应用程序,而无需验证和同步。第二个是,Firebase DB
不能用作本地数据库。
我是对的?与其他本地数据库一起使用Firebase DB是否可行?
相关问题:
<他希望和我想要的一样:
$ 链接 b $ b
我的计划是为用户提供保持离线的选项
HTML5混合应用程序的一些选项
这不是OP询问的内容,但希望对一些搜索者有用。 b
$ b
您可以使用客户端和服务器数据库的任意组合来实现在设备中存储远程维护的数据,以便在离线时可用。
$ b //www.sqlite.org/rel =nofollow> SQLite
(使用native浏览器数据库,的作品在iOS Safari
和Android webkit浏览器)
IndexdDB
(另一个native选项,但在早期的Android中不支持,或
完全支持iOS - 所以 NOT 是一个不错的选择) / p>
JayData <
(它提供了一个基本本地实现的抽象层)
(另一个流行的客户端抽象 - 我发现文档缺乏,并没有使用这个原因)
一些服务器选项:
>
In my app I have SQLite db
. I want to introduce sync between devices of my users. Firebase DB
looks like an acceptable solution, but Firebase DB
is cloud db at first. So, I can't use it as local db if user will reject auth dialog and let him use app, but without cloud-sync.
Now I think about combining my local SQLite db
with cloud Firebase db
.
For example, when user adds new row to local SQLite db
, my app will also put data into Firebase DB
. Other devices of this user will catch this event and update their local db. When the user uses authentification and installs app on new device, I want it to download all rows and put them into local SQLite db
. That's my idea: use Firebase DB
only for synchronizing data, not for storing it at device. Main reason for it is to let user use my app without authentification&synchonization. The second is that Firebase DB
is not designed to be used as local db.
I'm right? Is it okay to use Firebase DB with another local DB?
Related question:
link He want the same as I want:
my plan is to offer the user the option to stay offline
Some options for HTML5 hybrid apps
This is not what the OP asked about, but hopefully useful to some seekers.
You can use any combination of client and server database to implement storing remotely-maintained data in the device so it will be available when offline.
Some client options :
SQLite
(which is using the "native" browser database, works on iOS Safari and Android webkit browsers)IndexdDB
(another "native" option, but not supported in early Android, or fully supported for iOS - so NOT a good option)JayData
(which provides an abstraction layer from the underlying native implementation)- Lawnchair
(another popular client abstraction - I found the documentation lacking and have not used this for that reason)
Some server options :
这篇关于使用Firebase DB和本地数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!