Difference Between CoreData and Database in iPhone

Database

  • Its primary function is to store and fetch data.
  • It operates on data stored on disk.
  • It can store "dumb" data.
  • It can be transactional, thread-safe, multi-user.
  • Can drop tables and edit data without loading into memory.
  • Perpetually saved to disk.
  • Can be slowto create millions of new rows.
  • Offers data constraints like "unique" keys.

CoreData

  • Its primary function is graph management.
  • It can operate on objects stored in memory.
  • Works with fully-fledged objects that self-manage many of their behavior and can be subclassed and customized for further behaviors.
  • Non-transactional, single threaded, single user.
  • It only operates in memory.
  • Requires a save process.
  • Can create millions of new objects in-memory very quickly.
  • Leaves data constraints to the business logic side of the program.

Sqlite

  • To implement its graph management, Core Data happens to use sqlite as a disk store.
  • It could have been implemented using a different relational database or even a non-relational database such as CouchDB.
  • In this we can work with SQL query.
  • SQLite does not require a separate server process or system to operate.
  • The SQLite library accesses its storage files directly.
  • SQLite supports most of the query language features found in the SQL92 (SQL2) standard.
     


Similar Articles