iPhone上的Tokyo Cabinet vs SQLite3

时间:2021-10-21 05:28:01

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.

有没有人在iPhone上使用东京内阁?我很想知道它和SQLite3之间是否存在任何真实的性能差异。

Also, SQLite 3 has the expressive power of SQL, does Tokyo Cabinet have any kind of query language?

另外,SQLite 3具有SQL的表现力,Tokyo Cabinet是否有任何类型的查询语言?

Any input would be greatly appreciated, thanks.

任何意见都将非常感谢,谢谢。

3 个解决方案

#1


3  

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.

我没有专门在iPhone上使用过,但我已经将它们用于各种项目。正如您所指出的,SQLite确实提供了SQL查询语言,这意味着您可以更灵活地搜索和查找数据。假设您熟悉SQL,您将能够轻松过滤,关联和汇总结果。

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).

Tokyo Cabinet提供不同类型的数据存储系统,因为它是一个键值存储。顾名思义,这些系统用于存储(密钥,值)对。存储在TC中的数据必须具有可以引用的唯一键,并且只能由该键引用。访问TC的接口基本上是value = get(key)和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.

从查询角度来看,访问TC大致相当于使用SQLite,只允许使用主键字段和另外一个数据字段。

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.

TC的主要好处是性能。它是否以及如何更好地取决于工作量。一般来说,如果您只需要一个键值存储,那么您应该使用TC,但如果您需要SQL查询语言,那么它就是SQLite。

#2


2  

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.

BNRPersistence是在Tokyo Cabinet上构建的持久性对象库,我认为它是一个非常好的解决方案。在网络上,核心数据和东京内阁之间进行了比较。

#3


0  

The Tokyo Cabinet license doesn't let you do static linking so it cannot be used for iPhone development.

东京内阁许可证不允许您进行静态链接,因此它不能用于iPhone开发。

#1


3  

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.

我没有专门在iPhone上使用过,但我已经将它们用于各种项目。正如您所指出的,SQLite确实提供了SQL查询语言,这意味着您可以更灵活地搜索和查找数据。假设您熟悉SQL,您将能够轻松过滤,关联和汇总结果。

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).

Tokyo Cabinet提供不同类型的数据存储系统,因为它是一个键值存储。顾名思义,这些系统用于存储(密钥,值)对。存储在TC中的数据必须具有可以引用的唯一键,并且只能由该键引用。访问TC的接口基本上是value = get(key)和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.

从查询角度来看,访问TC大致相当于使用SQLite,只允许使用主键字段和另外一个数据字段。

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.

TC的主要好处是性能。它是否以及如何更好地取决于工作量。一般来说,如果您只需要一个键值存储,那么您应该使用TC,但如果您需要SQL查询语言,那么它就是SQLite。

#2


2  

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.

BNRPersistence是在Tokyo Cabinet上构建的持久性对象库,我认为它是一个非常好的解决方案。在网络上,核心数据和东京内阁之间进行了比较。

#3


0  

The Tokyo Cabinet license doesn't let you do static linking so it cannot be used for iPhone development.

东京内阁许可证不允许您进行静态链接,因此它不能用于iPhone开发。