views:

215

answers:

4

Are there any other database engines that could be used on the iPhone, besides sqlite3? Something like textDb is for PHP, single-file and no server.

A: 

No. Everyone seems to be happy with SQLite.

rein
everyone - 1, that is.
luvieere
Presumably you are the -1 you refer to. Why are you not happy with it?
rein
I want a single-file db to include with my app - not sqlite, something else. I don't get why are people so reluctant in suggesting alternatives for the sake of just alternatives - I see it like asking what's wrong with Coca-Cola that you're asking for Pepsi or something else?
luvieere
The reason people are 'reluctant' to suggest alternatives is because people are happily using SQLite without issues, and so they don't bother to go out of the way to LOOK for alternatives that may or may not exist.
Ed Marty
recommending alternatives might probably be easier if you could state why you are unhappy with sqlite. though i guess you already did realize that.
tosh
A: 

I think your problem is that you are thinking of a software library more like a software product. People want choice between Internet browsers for all sorts of reasons. But when you have a software library, it's pretty much set up for one purpose. If it doesn't fulfill that purpose well enough, it shouldn't be a library.

Do you not like NSObject? Do you not like the Core Foundation library? Then write your own. However, to drag up an unfortunately overused analogy, don't reinvent the wheel, unless your job is making new and innovative wheels.

SQLite does perform acceptably, and so it is supplied as a library on the iPhone platform. SQLite works for what I need it to do. If it doesn't work for you, then maybe you have some reason you'd like to share?

Freedom of choice is fine if you want to choose between Internet browsers, but I would think that as a programmer, one should have a very specific reason for going out of their way, spending valuable time to fix something that already works. Even with my choice of Internet browser, I have specific reasons I choose one over another.

Ed Marty
I am a curious person, willing to invest time in finding alternatives for the sake of knowing if and what they are. I searched, failed in finding, and asked here for additional input. I'm always interested in finding new and impressive stuff, and I test Internet browsers just out of curiosity - to explore the alternatives, to compare, to draw conclusions. Not having an alternative is boring, no matter how efficient it may be. Libraries might they be, but I've come across a ton of XML libraries, JSON libraries and other for the iPhone, so why couldn't they be more database engines too?
luvieere
+1  A: 

If you're looking for an alternative, I would say Core Data. I had the same question for a long time and even used SQLite in some projects. After speaking with an Apple Engineer though, he pointed out that Core Data could do everything that I was using SQLite for (mainly just storing information and accessing it in a few different ways).

I would start with the with Core Data Programming Guide and see how it works for what you're looking to do.

withfoam
+3  A: 

There are a slew of alternatives to SQLite, but there is little point to using them as others have pointed out.

Before pointing out some alternatives, some points:

First, SQLite is an excellent single-file, non-client-server, small-footprint SQL database. The performance is excellent, it is a relatively tiny runtime, and it is thoroughly fast. There isn't an embeddable SQL-interpreting alternative that is either all around technically superior or anywhere near as popular.

Secondly, if you are doing persistency in an iPhone application, you should very likely be using CoreData. There are certainly reasons not to, but they are pretty uncommon. Beyond being a higher level mapping to a relational store that is quite adeptly integrated with Cocoa Touch, Core Data solves a number of very difficult problems above and beyond persistency; object graph management, efficient memory use (i.e. push stuff out of memory when no longer needed), and undo support, to name a few.

Finally, if you do decide to use some other database persistency layer, keep in mind that the iPhone 3G and prior is an extremely memory constrained runtime environment. The very presence of any kind of additional library can significantly reduce the working memory available to your app. Whatever solution you choose, make sure it is optimized to use as little memory as possible.

So, seriously, if you are looking to not use SQLite or CoreData it is either because you have a very rare case where they aren't appropriate or because you are being curious. If curious, well... good for you!

If you are looking for alternatives, the SQLite documentation includes a set of links to similar products.

Pretty sparse list and it isn't because the author is hiding anything. There simply isn't a lot of motivation in the industry to try and re-invent this particular wheel because SQLite does a really good job. There is a reason why Google, Adobe, GE, FireFox, Microsoft, Sun, REALBasic, Skype, Symbian, Apple, and others have pretty much standardized on SQLite to solve their non-client/server relational persistency needs; it just works.

bbum
I've seen the competitors on that page, but I'm interested only in the ones with cocoa-iPhone access layer, something that I could actually use on the iPhone.
luvieere
If they are written in C (or C++), they can be used on the iPhone. You will have to port them (likely not that hard) and then figure out if they'll actually meet the memory requirements of the device (likely not unless they target embedded on other platforms).
bbum