SQLite与核心数据:我从哪里开始? [英] SQLite vs. Core Data: Where do I begin?

查看:71
本文介绍了SQLite与核心数据:我从哪里开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读和学习有关sqlite&过去几天的核心数据,我只是无法掌握哪种方法更适合我的应用?我更喜欢使用Core Data,因为我在Stanford的课程中都学过,并且觉得自己对此有所了解。但是似乎也无法仅通过Core Data来完成我想对我的应用进行的操作。

I have been reading and learning a lot about sqlite & core data for the past few days, and I just can't grasp which method is better for my app? I would prefer to use Core Data because I worked through the Stanford courses on it, and feel like I understand that better. But it also seems like it's not possible to do what I want to do with my app by just using Core Data.

基本上,我正在尝试模拟Twitter使用的系统。我的意思是用户注册,创建个人资料,然后在发布内容时,他们的朋友会在供稿中看到它。

Basically, I'm attempting to mock the system that Twitter uses. What I mean is that users sign up, create a profile, and when they post things, their friends see it in a feed.

是否可以仅通过使用Core Data在庞大的用户群中创建这样的系统?还是我需要同时使用Core Data和SQLite?

Is it possible to create a system like this among a large user base by simply using Core Data? Or do I need to use both Core Data & SQLite?

谢谢!

推荐答案

创建共享系统,例如那,您将需要设备连接到的云中的一项服务。

To create a shared system like that, you will need a service in the cloud that the devices connect to.

设备必须从具有本地存储的云服务中提取数据-特别是如果您希望在断开连接时显示或使用数据。本地存储还可以提供更好的性能。

The devices would have to pull data from the cloud service with local storage - especially if you want the data to be visible or usable while they are disconnected. Local storage can also provide better performance.

关于CoreData与SqlLite-CoreData仅适用于iOS,但它可以让您运行得更快,并可以让一个好的设计师和一个好的设计师保持生产力。 API集。 SqlLite的级别低得多,可让您直接控制存储和查询的sql。当然,也可以为本地存储编写类似您在sqlite或核心数据中描述的内容。

Concerning CoreData vs SqlLite - CoreData is for iOS only but it gets you going faster and keeps you productive with a nice designer and a nice set of APIs. SqlLite is much lower level giving you direct sql control over your storage and queries. It's certainly possible to write local storage for something like your describing in sqlite or core data.

另一个考虑因素是您是否要共享该存储代码(模式/查询/等等),最终跨Windows Phone,Android等其他平台使用。Sqllite是跨平台的,在设备和台式机上都非常有效。在某些情况下,自身存储(数据文件)可以跨设备平台移植。

The other consideration is whether you want to share that storage code (schema/queries/etc...) across other platforms eventually like Windows Phone, Android, etc... Sqllite is cross platform and works great on devices and desktops. In some scenarios, the store it self (the data file) could be portable across devices platforms.

要考虑的是存储的复杂性以及是否要在设备之间共享某些存储空间还是仅单独编写代码。这里没有一个正确的答案。

Depending on the complexity of your storage and whether you want to share some of that across devices or just code separately is a consideration. There is no one right answer here.

这篇关于SQLite与核心数据:我从哪里开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆