开发者

Difference between Core Data and SQLite [closed]

开发者 https://www.devze.com 2023-03-19 11:15 出处:网络
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing th
Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 3 years ago.

Improve this question

What is the basic difference between Data and SQLite, as both are databases and can be used with iOS development. Which is better for saving and retri开发者_如何学Goeving large data?


There is a huge difference between these two.

SQLite is a database itself like we have MS SQL Server.

But Core Data is an ORM (Object Relational Model) which creates a layer between the database and the UI. It speeds-up the process of interaction as we don't have to write queries, just work with the ORM and let ORM handles the backend.

For saving or retrieving large data, I recommend to use Core Data because of its abilities to handle the lower processing speed of iOS devices.

@Arundhati: Using Core Data we can optimize the memory efficiently.


Apart from being ORM (Object Relational Model) You can compare Core-Data and SQLite as;

SQLite:

  • Have Data Constrains feature.
  • Operates on data, stored on disk.
  • Can Drop table and Edit data without loading them in memory.
  • Slow as compared to core data.

Core Data:

  • Don't have Data Constraints,if required need to implement by business logic.
  • Operates on in memory.(data needs to be loaded from disk to memory)
  • Need to load entire data if we need to drop table or update.
  • Fast in terms of record creation.(saving them may be time consuming)

Additionally apart from SQLite as back-end Core data can use XML or binary format for storing data to disk.


There is a big difference between coredata and sqlite.

Core data in itself is not a database it is just a change tracking system a wrapper over the persistent stores like SQLite(retrive, save objects to the persistent store). You can have SQLite as your underlying RDBMS and coredata can be used as a layer for managing the change to the properties of the tables (undo, redo, reset the changes), it is also optimized in managing the memory(faulting).


Core Data:

  1. Not a database, its a framework for managing object graph (collection of interconnected objects)
  2. It uses SQLite for its persistent store.
  3. Framework excels at managing complex object graphs and its life cycles.
  4. It can optionally persist the object graph to disk and it also offers a powerful interface for searching the object graph it manages.
  5. The framework adds a number of other compelling features, such as input validation, data model versioning, and change tracking.
  6. It has also other Persistent store types like binary store and an in-memory store
  7. Important: The database schema of the SQLite database used by Core Data is an implementation detail of the framework. It isn't publicly documented and liable to change.

SQLite:

  1. Relational database
  2. Lightweight DB and stored on disk
  3. SQLite does not require a separate server process or system to operate.


SQLite is a database while Core Data is not. Core Data is a framework which manages an object graph. Core Data is fast in terms of operation. It don't hit the database every time for operations. Whereas SQLite interacts with the database every time for operations. Core data keeps the operations in primary memory i.e cache so it works fast.


Using core data we can optimize the memory efficiently.

0

精彩评论

暂无评论...
验证码 换一张
取 消