开发者

What is the difference between Tokyo Cabinet and Kyoto Cabinet?

开发者 https://www.devze.com 2023-01-24 20:15 出处:网络
FA开发者_如何学CL Labs has multiple Tokyo products and Kyoto products: Tokyo Cabinet and Kyoto Cabinet are both lightweight database libraries.

FA开发者_如何学CL Labs has multiple Tokyo products and Kyoto products:

  • Tokyo Cabinet and Kyoto Cabinet are both lightweight database libraries.
  • Tokyo Tyrant and Kyoto Tycoon are both lightweight database servers...

Can someone explain the difference between Tokyo and Kyoto products?


Tokyo Cabinet is more complete and stable, Kyoto is too fresh yet (today is Dec 8 2010) and has some issues. Kyoto, written in C++, is (much) more simple than Tokyo (written in C), but this simplicity let some gap. The performance of Kyoto is a little bit worse than Tokyo, but works better with threads (at least the documentation promises that).

From the official documentation:

<< In 2007, Tokyo Cabinet was developed as the successor to QDBM on the following purposes. They were achieved and Tokyo Cabinet could replace conventional DBM products.

(...)

In 2009, Kyoto Cabinet was developed as another successor to QDBM. Compared with the sibling product (Tokyo Cabinet), the following advantages were pursued. However, the performance of Tokyo Cabinet is higher than Kyoto Cabinet, at least in single thread operations. >>

I used both, but I still prefer Tokyo, because I had a problem with Kyoto: In Kyoto Cabinet Database using File Hash Database, how can avoid file size increasing? and no one was able to help me. I still don't know how to solve that.

In my personal experience, I found Kyoto easier to compile and install, and also easier to use. I had big problems with Tokyo library dependences and problems to link the native library with the Java interface. With Kyoto everything was good and works fine in the first attempt. But, as I said before, I feel more control over the database using Tokyo.


Tokyo Cabinet and Tyrant are LGPL and written in C. Kyoto Cabinet and Tycoon are GPLv3 and written in C++.

Kyoto Tyrant supports expired records in memory, so it can replace memcached.

The developer says Kyoto* isn't successor of Tokyo*, but it's just a marketing strategy; if you're not gonna develop a commercial product, use Kyoto. It's newer and better.

And I suggest you to read the developer's blog (both Japanese and English]) and read header files carefully (if you're gonna use the library).

Good luck.


The most important difference between the two in regard to my use cases is that TC has a "table database" while KC has not.

Yes, you can serialize arbitrary data to string and store it as item value, but then you either cannot search by value at all, or need to iterate over the whole dataset and deserialize each item, or reinvent the wheel and manually index the data.

Tokyo Cabinet's TDB provides excellent query capabilities for nested data (indexes, numeric and string comparison, even regular expressions within "fields"). The Kyoto thing is just a KV store; TC is also a powerful document-oriented database.


Also, according to test what I did, protocol of Kyoto is only HTTP based - more open, but slower than binary protocol of Tokyo thing.

0

精彩评论

暂无评论...
验证码 换一张
取 消