views:

235

answers:

2

I'm looking to develop a small application on Mac OSX and it will need to use a database. Can anyone recommend one for the Mac? This will be my first Mac development so this is very much a newbie question.

To help you I am interested in the following aspects:

  • Is it suitable for small applications? (Important)
  • Is it suitable for larger applications? How large an application could it support?
  • The application will store data locally, but in the future may end up sharing a schema with something on the network/in the cloud.
  • Are there any good libraries/ORMs for using it?
  • Are there any cool features that may not be obvious to a newbie?
  • Why do you like using it?
  • Is it a relational database? Or something else?
  • My app will need to version pieces of "content" at some point

Please feel free to add anything else that I should be considering. I'm also happy for you to think outside the box so OO databases or Git-like approaches would be cool.

Thanks for your help...

+1  A: 

Well, some relational DB will probably fit your bill quite nicely.

For starters, you should check out SQLite, it's a SQL db that is made for embedding.

That way, you get to use regular SQL (or an ORM of your choice) right from the start, and you can relatively painlessly migrate to a "bigger" SQL db if you later need it.

To address your points:

  • Is it suitable for small applications? (Important) yes, especially useful for embedded use with little overhead
  • Is it suitable for larger applications? How large an application could it support? depends on your precise needs, but you can always migrate to a different db later
  • The application will store data locally, but in the future may end up sharing a schema with something on the network/in the cloud.SQLite will store data locally, another db could be used for network storage
  • Are there any good libraries/ORMs for using it? at least Hibernate supports it explicitly, other ORM should work as it is a SQL db
  • Are there any cool features that may not be obvious to a newbie? -
  • Why do you like using it? low overhead, fast, easy to set up, yet an SQL dbms
  • Is it a relational database? Or something else? relational
  • My app will need to version pieces of "content" at some point no special support, but usually handled inside the schema anyway
sleske
This answer is misleading; it misses on critical component. The very first persistence solution that should be considered is Core Data. It fits all of the needs directly except the "store data in the cloud" requirement. However, that is so vague that a client/server database might likely not be the answer anyway.
bbum
Thanks, didn't know about Core Data.
sleske
Dont take this the wrong way, but my curiosity begs the question, how could you NOT know about core data?
Jacob
@Jacob: A reasonable question. I have no development experience with Mac OS X, so my answer was from a cross-platform point of view. I did not know that Mac OS has a special DB component.
sleske
+12  A: 

You should look into Core Data -- it's basically an ORM built with an SQLite back end, and it is included with OS X Tiger and forward.

So, there's no need to reinvent the wheel.

Read Core Data Programming Guide over at Apple.

richardtallent
I have to second this! Core Data is really easy to work with and very powerful. It integrates very well with XCode too. It's written and tested by Apple, so use it! :)
Ariejan