Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tokyo Cabinet vs SQLite3 on iPhone

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.

like image 293
Jasarien Avatar asked Aug 04 '09 09:08

Jasarien


1 Answers

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.

like image 154
jkupferman Avatar answered Sep 18 '22 02:09

jkupferman