Tokyo Cabinet Tutorial: Database Types and Configuration Options
A great piece of documentation for the 3 different storage types supported by Tokyo Cabinet: hash, B+ tree and fixed-length. The article also features a long list of tuning parameters.
Here are a couple of things that I’ve learned myself:
- Tokyo Cabinet support multi-operation transactions
- the extension of the file determines the type of storage:
tch: Tokyo Cabinet Hash databasetcb: Tokyo Cabinet B+Tree databasetcf: Tokyo Cabinet Fixed-Length database
- while Tokyo Cabinet B+Tree storage might be a bit slower than Tokyo Cabinet Hash storage, it brings new features:
- keys are ordered (default lexical, but can be configured by passing a comparison function)
- as a consequence it supports key ranges
- allows duplicate values to be stored under the same key
- Tokyo Cabinet Fixed-Length has some restrictions:
- all keys are positive integers
- as Tokyo Cabinet B+Tree keys are ordered (based on the integer keys) and it is not configurable
- all values stored have fixed-length
- on the bright side, Tokyo Cabinet Fixed-Length support some special keys:
:min,:max,:prevand:next.
I think this is a great contribution by James Edward Gray II to the Tokyo Cabinet community which is facing some problems including the lack of documentation.
via: http://blog.grayproductions.net/articles/tokyo_cabinets_keyvalue_database_types