简体   繁体   English

Mac OSX开发中常见的单用户数据库是什么?

[英]What is a common single-user database for Mac OSX development?

I am just starting to study and develop Mac OSX applications, and I'd like to design an app that uses a database. 我刚刚开始研究和开发Mac OSX应用程序,并且我想设计一个使用数据库的应用程序。

I'm not opposed to something like MySQL, but I'm looking for something that can be single user and can be stored directly on the device so internet access is not required. 我不反对MySQL之类的东西,但是我正在寻找可以是单用户并且可以直接存储在设备上的东西,因此不需要Internet访问。 I'd prefer not to resort to writing/reading from a file either. 我也不想使用文件读写。

The closest I've come to find is SQLite, which I am familiar with in Android development, but my question is: is that what most OSX developers use? 我找到的最接近的是我在Android开发中熟悉的SQLite,但是我的问题是:大多数OSX开发人员使用的是什么?

I am trying to pose this question in a way that is not opinion-driven, as I know there are countless DBMS out there. 我试图以一种不受观点驱动的方式提出这个问题,因为我知道那里有无数的DBMS。 Is there one that leads the pack as far as being used with OSX? 有没有一种可以与OSX一起使用?

Higher Abstractions: 高级抽象:

Core Data is available on iOS and OSX. 核心数据在iOS和OSX上可用。

Realm is a popular alternative to Core Data. Realm是Core Data的流行替代方案。 Some of the features include: 一些功能包括:

  • Fast 快速
  • Memory efficient 高效记忆
  • Its safe and easy to use across multiple threads (core data can be tricky here). 它在多个线程中安全且易于使用(核心数据在这里可能很棘手)。

Like Core Data it uses the Active Record pattern, where persistence methods are defined on the model objects themselves (unlike the DAO pattern, which uses a separate interface). 与Core Data一样,它使用Active Record模式,其中持久性方法是在模型对象本身上定义的(与DAO模式不同,DAO模式使用单独的接口)。

Lower Abstractions: 较低的抽象:

FMDB is a nice Objective-C API that sits over the pure C API to sqlite. FMDB是一个很好的Objective-C API,它位于纯C API之上,但仅适用于sqlite。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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