Tokyo Cabinet, Tokyo Tyrant and Rufus Tokyo in Ubuntu from Github

Blog ยป Tokyo Cabinet, Tokyo Tyrant and Rufus Tokyo in Ubuntu from Github

Posted on 08 Jul 2009 16:22

After reading the performance of Tokyo Cabinet, it was necessary to try it. It's easy to install it and try it in Ruby:

Hint: CTRL+SHIFT+V pastes in Ubuntu terminal. You can paste the code from web pages.

Install Tokyo Cabinet and Tokyo Tyrant from Github:

cd /usr/local/src

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

cd tokyo-cabinet/
./configure
make
sudo make install

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

Those instructions are similar to that of Openwferu but, at least today, clement is more up-to-date then etrepum.

Then install the Ruby interface

sudo gem install rufus-tokyo

Fire your irb and play with the examples

For example,

  require 'rubygems'
  require 'rufus/tokyo'
 
  db = Rufus::Tokyo::Cabinet.new('data.tch')
 
  db['nada'] = 'surf'
 
  p db['nada'] # => 'surf'
  p db['lost'] # => nil
 
  db.close

Check also On the Way to Faster, Bigger Rails Applications

If you like this page, please spread the word: diggdel.icio.usFacebook

You can contact me if you have questions or corrections.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License