public
Description: Lean & mean Tokyo Cabinet recipes (with Lua)
Homepage:
Clone URL: git://github.com/igrigorik/tokyo-recipes.git
igrigorik (author)
Fri Jul 10 14:03:18 -0700 2009
commit  1fdaf47a1fcf7a77e721379b1efa9cc0a510f72f
tree    07fb4b09ad70f2428769a4079c7916db8ebc76f8
parent  cec510f5419793e3331c5dd97487764133e6e79e
README.rdoc

Tokyo Cabinet is a library of routines for managing a database. The database is a simple data file containing records, each is a pair of a key and a value. Every key and value is serial bytes with variable length. Both binary data and character string can be used as a key and a value. There is neither concept of data tables nor data types. Records are organized in hash table, B+ tree, or fixed-length array.

User Defined Functions (UDF’s) via Lua

As of mid ‘08, Hirabayashi-san embedded Lua into Tokyo Cabinet’s runtime to allow for easy extensibility of the database. There is a common set of Lua API’s built in, which allow you to interact with the underlying data, execute your extensions remotely, or even on a timer. This allows us to build additional functionality on top of the Tokyo Cabinet database with Lua!

A few examples you will find in this repository:

  • Simple echo application
  • Implemention of sets operations (like Redis) on top of TC
  • Example of executing Map-Reduce jobs on data within TC
  • TTL / Expire functionality (like memcached)
  • and many others…

Please do fork the repo and add your recipes to the list!

Installing Tokyo Cabinet with Lua

  yum install lua lua-devel

  git clone git://github.com/etrepum/tokyo-cabinet.git
  git clone git://github.com/etrepum/tokyo-tyrant.git

  (or get latest files from sourceforge: http://sourceforge.net/projects/tokyocabinet/files/)

  cd tokyo-cabinet
  ./configure --enable-lua
  make && make install

  cd tokyo-tyrant
  ./configure
  make && make install

  gem install rufus-tokyo

Source: openwferu.rubyforge.org/tokyo.html