Tokyo Cabinet and Python
Tokyo Cabinet is a scalable key-value database that can be used in high performance applications, including Python.
Tokyo Cabinet is a library for key-value database management developed by Mikio Hirabayashi. It's used on a very big site mixi.jp (and others). Tokyo Cabinet is a simple and scalable way to store data. There are also few additions - Tokyo Tyrant which is a server for Cabinet databases, Tokyo Dystopia which is a library for fulltext searches for those databases. All libraries are written in C and released on LGPL license.
InstalationIn case of Linux/Unix systems we only need the compiler like GCC. If the Tokyo libraries aren't in your distribution repository just download the sources and compile them the standard way:
./configure --prefix=/usr make make install
Database handling with TyrantTokyo Tyrant provides us with the command line tool ttserver. The simplest way is to use "ttserver start", but to make it useful and launch a file database with server running in the background use:
Using Tokyo Tyrant in PythonFor Python we can use pytyrant module:
There is also pytc library, which is a direct API for Tokyo Cabinet (examples).
On Slideshare you can find nice slides: Building TweetReach with Sinatra, Tokyo Cabinet and Grackle: Austin on Rails, Pylons + Tokyo Cabinet, Introduction to Tokyo Products. Plurk used Tokyo Cabinet for its database LightCloud, which is a "better" memcache replacement.