我的 iPhone 应用程序的设备上数据库
我想要为我的 iPhone 应用程序建立设备上数据库。它涉及数据,这些数据来自包含 200.000 个事物及其定义的字典。它仅与出现的文本类型数据相关。我的问题:
1- SQLite 是否保存所有这些数据?
2-当客户下载我的应用程序时,他/她的设备中也会有数据库。应用程序商店是否允许我更新应用程序的数据库并上传我的新版本? (顺便说一下,我不太了解这些问题)
3-下载我的应用程序的任何客户都可以破解并获取我的数据库吗?有什么预防方法吗? SQLite 是否有足够的弹性来应对这些问题?
I want to have on-the-device database for my iphone app. It concerns with the data, which comes from dictionary consisting of 200.000 things and their definitions. It is only related with text-type data as appeared. My questions:
1- Does SQLite hold all of these data?
2- When the client downloaded my app, he/she will also have the db in his/her device. Does app store allow me to update my app's db and upload my new release? (i don't know these issues well by the way)
3- And can any client, who downloaded my app, hack and obtain my database? Is there any prevention methods? Is SQLite resilient enough against these?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,SQLite 可以处理这么大的数据量。
一般方法是将 SQLite 数据库存储在应用程序包中,然后在应用程序首次运行时将数据库复制到设备上的应用程序文档目录中。在后续更新您的应用程序时,您应该检查文档目录中的数据库是否是相同版本,并在必要时进行更新。请参阅现有的从文档文件夹运行 NSBundle 问题/答案欲了解更多信息。
打开应用程序相当简单(毕竟部署包只是一个 zip 文件),所以是的,将有可能获得对数据库数据的访问权限。不幸的是,据我所知,没有简单的方法可以解决这个问题。 (我可以假设您第一次运行应用程序时从服务器下载数据,但在越狱设备上仍然可以访问它。)
有时,您只需要硬着头皮接受这样的事实:您的数据将被被敲诈。
Yes, SQLite can cope with this amount of data.
The general approach is to store the SQLite database in your application bundle and then copy the database into the application's document directory on the device when the application is first run. On subsequent updates to your applciation, you should check if the database within the document directory is the same version and update it if necessary. See the existing Run NSBundle from the documents folder question/answer for more information on this.
It's fairly trivial to open up an app (the deployment package is just a zip file after all), so yes, it will be possible to obtain access to your database data. Unfortunately there's no easy way around this that I'm aware of. (You could I suppose download the data from a server when you first run you app, but it'll still be accessible on a jailbroken device.)
Sometimes, you just have to bite the bullet and accept the fact that your data is going to be ripped off.
1)sqllite绝对可以容纳那么多数据。
2)您可以在应用程序中设置刷新数据库的选项。这可用于将本地数据库与服务器副本同步。更新的数据库也可以添加到新版本的应用程序中。
3)您可以使用 SQLCipher 加密本地数据库以进行保护您的应用程序数据库可防止黑客攻击。
1) sqllite can definitely hold that amount of data.
2) You can put up an option of refreshing the database in your app. That can be used to sync the local db with the server copy. Updated db can also be added with the new version of the app.
3) You can encrypt your local db using SQLCipher for protecting your application db against hacks.