OS X App. What is the best way to store data?

In the os x app, which is the best way to store hundreds of user records with lots of information for each record?

I know that I can use CoreData, SQLite, Realm, plist or another solution. Which one is the most compatible (e.g. for web use) and the clean / easy / fast method / type of database for storing data?

thanks

+5
source share
2 answers

The core data is written by Apple to be used in Cocoa-based applications. It is already included in the operating system, has 10 years of development behind it and is already used in hundreds of thousands of applications in the application store.

Using a third-party library is fraught with huge risks.

I always recommend using Core Data for iOS and OS X because it is written by Apple, it has a fully supported development team and is a mature code base.

Using raw SQLite is possible, but you won’t get the same performance benefits you get with Core Data.

The kingdom focuses on the wrong things. Their data migration system is scary; they focus on raw speed when they need to focus on the big picture. They can focus on mobile devices, but I do not agree with their goals.

Hundreds of records are not difficult for any database system. This is when you get up to 10 thousand records on the device, many of which begin to fall due to memory pressure (even on OS X).

Master data is designed to support memory pressure. I do not know about any third part platform that will do this.

+12
source

I think the most important thing is to compare the Kingdom with another database. Realm uses its own native kernel, and the rest is based on SQLite (CoreData uses SQLite). Realm is the first database designed for mobile use. So, in your case ( OSX ), you should consider whether your application has the same features as mobile applications: device restrictions.

Kingdom:

  • Very fast methods: see an example here
  • Fast execution: see the table here , yes thousands of user entries!
  • Light: embedded database less than 1 MB

  • But in beta. This means that they are constantly under development.

SQLite:

"lite" in the name means it is a lightweight database. You have many libraries available on github to help you, complete documentation and complete examples.

Personnaly, I am using Realm for my OSX application, and although it is in beta, I have all the necessary functions. The kingdom is faster than CoreData, and save a thousand lines of code and months of work. :)

I hope this helps you.

+5
source

Source: https://habr.com/ru/post/1233036/


All Articles