Has anyone used Tokyo Cabinet on the iPhone? I'm interested to see if there are any real world performance differences between it and SQLite3.
Also, SQLite 3 has the expressive power of SQL, does Tokyo Cabinet have any kind of query language?
Any input would be greatly appreciated, thanks.
I have not used either on the iPhone specifically, but I have used both for various projects. Like you pointed out, SQLite does provide SQL query language which means you have much more flexibility in how you can search for and find data. Assuming you are comfortable with SQL you will be able to easily filter, relate, and aggregate results.
Tokyo Cabinet provides a different type of data storage system in that it is a key-value store. As the name implies, these systems are for storing (key,value) pairs. Data stored into TC must to have a unique key which it can be referenced, and it can only be referenced by that key. The interface for accessing TC is basically value=get(key) and set(key,value).
From a query perspective accessing TC is roughly equivalent to using SQLite and only allowing primary key fields and one other data field.
The major benefit of TC is performance. If and how much better it would be depends heavily on the workload. In general, if all you need is a key-value store then you should go with TC, but if you need a SQL query language then SQLite it is.
BNRPersistence is a persistence objects library build over Tokyo Cabinet, I think its a really nice solution. In the web there's a comparison between Core Data and Tokyo Cabinet.
The Tokyo Cabinet license doesn't let you do static linking so it cannot be used for iPhone development.
来源:https://stackoverflow.com/questions/1226539/tokyo-cabinet-vs-sqlite3-on-iphone