简体   繁体   中英

SQLite vs. Core Data: Where do I begin?

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.

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.

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?

Thanks!

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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