简体   繁体   English

我应该为我的ios应用程序使用什么类型的数据存储?

[英]What type of data store should I use for my ios app?

I am pretty new to ios and using servers so forgive me. 我对ios很新,使用服务器,请原谅我。

I am building an ios app for research. 我正在构建一个用于研究的ios应用程序。 I need to monitor things that the user does and then push it up to a server for analysis (yes, with user and IRB permission). 我需要监视用户执行的操作,然后将其推送到服务器进行分析(是的,具有用户和IRB权限)。 On the client's side I need to keep quite a bit of data that won't really change except in the case of pulling an updated version from the server, and then a minimal amount of user-specific data. 在客户端,我需要保留相当多的数据,除非从服务器提取更新版本,然后是最少量的用户特定数据,否则这些数据不会真正改变。 Most of the data I will collect needs to be pushed to a server for analysis and then can be deleted from the client side. 我将收集的大部分数据需要推送到服务器进行分析,然后可以从客户端删除。

I am struggling to figure out what kind of data store I need to use, especially since I am not quite sure how the pushing and pulling from the server process works yet. 我正在努力弄清楚我需要使用哪种数据存储,特别是因为我不太确定服务器进程的推送和工作是如何工作的。 Does it make sense to use Core Data? 使用核心数据是否有意义? XML? XML? SQLite? SQLite的? I like the Core Data idea, but I am not sure what kind of problems I will run into when I need to send large amounts of data to it and from it from the server. 我喜欢核心数据的想法,但我不确定当我需要向服务器发送大量数据并从服务器发送大量数据时会遇到什么样的问题。 I imagine I might need to send data in a different form than it is probably stored in on either end - so what kind of overhead am I likely to run into in the process of converting that data? 我想我可能需要以不同的形式发送数据,而不是存储在任何一端 - 所以在转换数据的过程中我可能遇到什么样的开销? Is there a good format to save stuff in that would work well for me on both ends AND for sending the data? 有没有一个很好的格式来保存东西,这对我来说两端都很好并且用于发送数据?

As you can probably tell, I could use some advice. 你可能会说,我可以使用一些建议。 Thanks! 谢谢!

Core Data is probably the way to go. 核心数据可能是最佳选择。

Either Core Data or SQLite is likely to be great for this sort of app. 无论是Core Data还是SQLite都可能适用于这类应用。 Core Data actually uses SQLite behind the scenes. Core Data实际上在幕后使用SQLite。 But Core Data has some advantages over SQLite and really is the preferred iOS database technology. 但Core Data比SQLite有一些优势,并且确实是首选的iOS数据库技术。

Regarding your performance concerns, I wouldn't worry about it. 关于您的性能问题,我不担心。 Core Data (or SQLite) is plenty fast enough. 核心数据(或SQLite)足够快。 The bandwidth to the server will be the gating factor, so you should be fine there. 服务器的带宽将是门控因素,所以你应该没问题。

It sounds like your data structure is likely to be rich enough or large enough that I wouldn't contemplate other approaches (plists, NSUserDefaults , other file formats, etc.). 听起来您的数据结构可能足够丰富或足够大,以至于我不会考虑其他方法(plist, NSUserDefaults ,其他文件格式等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM