Successfully reported this slideshow.
edo
                        cabinet



                                  http://tinyurl.com/edocabinet
Sunday, July 19, 20...
ruby and
                        tokyo cabinet



                                http://www.flickr.com/photos/kiim/3185168...
jmettraux

                        swiss guy
                        wants to write less code
                        ends...
why rufus-tokyo ?

                        need to persist data quickly




Sunday, July 19, 2009
Tokyo Cabinet|Tyrant

                        key/value store

                        persistent

                       ...
Hirabyashi-san is providing
                        ruby bindings

                        but no “sudo gem install”

    ...
Sunday, July 19, 2009
what I want

                        {}




Sunday, July 19, 2009
Sunday, July 19, 2009
what I want

                        what I built




Sunday, July 19, 2009
rufus-tokyo

                        ruby gem

                        Tokyo Cabinet
                        Tokyo Tyrant
...
http://blog.headius.com/2008/10/ffi-for-ruby-now-available.html
Sunday, July 19, 2009
ruby FFI




Sunday, July 19, 2009
FFI

                        Foreign Function Interface

                        common lisp
                        haske...
ruby FFI

                        from Rubinius

                        thanks to Wayne Meissner

                       ...
ruby FFI

                        an example

                        the ‘crypt’ function




Sunday, July 19, 2009
Sunday, July 19, 2009
http://files.getdropbox.com/u/76595/rk_crypt.rb
Sunday, July 19, 2009
ruby FFI

                        an example

                        ‘uuid_generate’




Sunday, July 19, 2009
http://files.getdropbox.com/u/76595/rk_uuid.rb
Sunday, July 19, 2009
ruby FFI flow

                        1) attach functions
                        2) call functions




Sunday, July 19, 2...
ruby FFI

                        an example

                        libevent




Sunday, July 19, 2009
http://files.getdropbox.com/u/76595/rk_libev.rb
Sunday, July 19, 2009
http://files.getdropbox.com/u/76595/rk_libev.rb
Sunday, July 19, 2009
Sunday, July 19, 2009
ruby FFI

                        more fun

                        from ruby to lua




Sunday, July 19, 2009
http://jmettraux.wordpress.com/2009/03/16/ruby-to-lua/
Sunday, July 19, 2009
http://github.com/remogatto/ffi-inliner/
Sunday, July 19, 2009
Sunday, July 19, 2009
Tokyo Cabinet|Tyrant




Sunday, July 19, 2009
Mikio Hirabayashi is the
                        author

                        mixi.jp is the source




               ...
http://alpha.mixi.co.jp/blog/?author=3
Sunday, July 19, 2009
http://www.slideshare.net/estraier/introduction-to-tokyo-products
Sunday, July 19, 2009
Sunday, July 19, 2009
rufus-tokyo




Sunday, July 19, 2009
2 products

                        Tokyo Cabinet
                        local file

                        Tokyo Tyrant
...
local   cabinet lib




Sunday, July 19, 2009
remote   tyrant server




                                  cabinet lib




Sunday, July 19, 2009
tt
                        memcached   tyrant server
                           http



                                  ...
2 flavours

                        - key/value (abstract)

                        - key/hash of values (table)




Sunday...
{ k => v }   { k => { k => v } }


                           hash
                          B+ tree           table
     ...
{ k => v }   { k => { k => v } }




                        abstract           table




Sunday, July 19, 2009
key/value

                        like { }




Sunday, July 19, 2009
Sunday, July 19, 2009
key/hash of values (table)

                        like a { pk => { } }




Sunday, July 19, 2009
Sunday, July 19, 2009
Sunday, July 19, 2009
local                            remote


                        Rufus::Tokyo::   Rufus::Tokyo::   Rufus::Tokyo::   Rufus...
tt-src $ .configure --enable-lua
                        tt-src $ make
                        tt-src $ sudo make install

...
http://jmettraux.wordpress.com/2009/04/07/rufus-tokyo-0112-extlua/
Sunday, July 19, 2009
http://www.igvita.com/2009/07/13/extending-tokyo-cabinet-db-with-lua/
Sunday, July 19, 2009
Sunday, July 19, 2009
Rufus::Edo




Sunday, July 19, 2009
FFI

                        + ruby, jruby
                        + no compilation when ‘gem install’

                  ...
Sunday, July 19, 2009
local                           remote

                                                         Rufus::Tokyo::


        ...
ruby to tyrant, the fastest

                        http://github.com/actsasflinn/
                        ruby-tokyotyran...
projects using rufus-tokyo

                        (github search)

                        - wycats/moneta
             ...
many thanks to

                        Mikio Hirabayashi
                        Zev Blut
                        Ilya Gr...
Upcoming SlideShare
Loading in …5
×

Edo Cabinet

6,435 views

Published on

Tokyo Cabinet|Tyrant, Ruby FFI, rufus-tokyo

Published in: Technology
  • Be the first to comment

Edo Cabinet

  1. 1. edo cabinet http://tinyurl.com/edocabinet Sunday, July 19, 2009
  2. 2. ruby and tokyo cabinet http://www.flickr.com/photos/kiim/3185168797/ Sunday, July 19, 2009
  3. 3. jmettraux swiss guy wants to write less code ends up writing too much http://github.com/jmettraux/ Sunday, July 19, 2009
  4. 4. why rufus-tokyo ? need to persist data quickly Sunday, July 19, 2009
  5. 5. Tokyo Cabinet|Tyrant key/value store persistent fast, fast, fast http://tokyocabinet.sourceforge.net/ Sunday, July 19, 2009
  6. 6. Hirabyashi-san is providing ruby bindings but no “sudo gem install” and it’s ‘extconf’ and ... http://tokyocabinet.sourceforge.net/rubydoc/ Sunday, July 19, 2009
  7. 7. Sunday, July 19, 2009
  8. 8. what I want {} Sunday, July 19, 2009
  9. 9. Sunday, July 19, 2009
  10. 10. what I want what I built Sunday, July 19, 2009
  11. 11. rufus-tokyo ruby gem Tokyo Cabinet Tokyo Tyrant ruby FFI Sunday, July 19, 2009
  12. 12. http://blog.headius.com/2008/10/ffi-for-ruby-now-available.html Sunday, July 19, 2009
  13. 13. ruby FFI Sunday, July 19, 2009
  14. 14. FFI Foreign Function Interface common lisp haskell Sunday, July 19, 2009
  15. 15. ruby FFI from Rubinius thanks to Wayne Meissner to jruby and ruby http://wmeissner.blogspot.com/2008/11/more-on-ruby-ffi.html Sunday, July 19, 2009
  16. 16. ruby FFI an example the ‘crypt’ function Sunday, July 19, 2009
  17. 17. Sunday, July 19, 2009
  18. 18. http://files.getdropbox.com/u/76595/rk_crypt.rb Sunday, July 19, 2009
  19. 19. ruby FFI an example ‘uuid_generate’ Sunday, July 19, 2009
  20. 20. http://files.getdropbox.com/u/76595/rk_uuid.rb Sunday, July 19, 2009
  21. 21. ruby FFI flow 1) attach functions 2) call functions Sunday, July 19, 2009
  22. 22. ruby FFI an example libevent Sunday, July 19, 2009
  23. 23. http://files.getdropbox.com/u/76595/rk_libev.rb Sunday, July 19, 2009
  24. 24. http://files.getdropbox.com/u/76595/rk_libev.rb Sunday, July 19, 2009
  25. 25. Sunday, July 19, 2009
  26. 26. ruby FFI more fun from ruby to lua Sunday, July 19, 2009
  27. 27. http://jmettraux.wordpress.com/2009/03/16/ruby-to-lua/ Sunday, July 19, 2009
  28. 28. http://github.com/remogatto/ffi-inliner/ Sunday, July 19, 2009
  29. 29. Sunday, July 19, 2009
  30. 30. Tokyo Cabinet|Tyrant Sunday, July 19, 2009
  31. 31. Mikio Hirabayashi is the author mixi.jp is the source http://tokyocabinet.sourceforge.net/index.html Sunday, July 19, 2009
  32. 32. http://alpha.mixi.co.jp/blog/?author=3 Sunday, July 19, 2009
  33. 33. http://www.slideshare.net/estraier/introduction-to-tokyo-products Sunday, July 19, 2009
  34. 34. Sunday, July 19, 2009
  35. 35. rufus-tokyo Sunday, July 19, 2009
  36. 36. 2 products Tokyo Cabinet local file Tokyo Tyrant remote cabinet file over TCP socket (or Unix socket) Sunday, July 19, 2009
  37. 37. local cabinet lib Sunday, July 19, 2009
  38. 38. remote tyrant server cabinet lib Sunday, July 19, 2009
  39. 39. tt memcached tyrant server http cabinet lib Sunday, July 19, 2009
  40. 40. 2 flavours - key/value (abstract) - key/hash of values (table) Sunday, July 19, 2009
  41. 41. { k => v } { k => { k => v } } hash B+ tree table fixed length Sunday, July 19, 2009
  42. 42. { k => v } { k => { k => v } } abstract table Sunday, July 19, 2009
  43. 43. key/value like { } Sunday, July 19, 2009
  44. 44. Sunday, July 19, 2009
  45. 45. key/hash of values (table) like a { pk => { } } Sunday, July 19, 2009
  46. 46. Sunday, July 19, 2009
  47. 47. Sunday, July 19, 2009
  48. 48. local remote Rufus::Tokyo:: Rufus::Tokyo:: Rufus::Tokyo:: Rufus::Tokyo:: Cabinet Table Tyrant TyrantTable {} { pk => { } } {} { pk => { } } 1+ accesses 1 access lua embedded Sunday, July 19, 2009
  49. 49. tt-src $ .configure --enable-lua tt-src $ make tt-src $ sudo make install http://openwferu.rubyforge.org/tokyo.html Sunday, July 19, 2009
  50. 50. http://jmettraux.wordpress.com/2009/04/07/rufus-tokyo-0112-extlua/ Sunday, July 19, 2009
  51. 51. http://www.igvita.com/2009/07/13/extending-tokyo-cabinet-db-with-lua/ Sunday, July 19, 2009
  52. 52. Sunday, July 19, 2009
  53. 53. Rufus::Edo Sunday, July 19, 2009
  54. 54. FFI + ruby, jruby + no compilation when ‘gem install’ - slower than classical c extension => Rufus::Edo Sunday, July 19, 2009
  55. 55. Sunday, July 19, 2009
  56. 56. local remote Rufus::Tokyo:: FFI Cabinet Table Tyrant TyrantTable Rufus::Edo:: c ext Cabinet Table ? ? pure ruby NetTyrant NetTyrantTable Sunday, July 19, 2009
  57. 57. ruby to tyrant, the fastest http://github.com/actsasflinn/ ruby-tokyotyrant/ ruby c extension for Tyrant rufus-tokyo friendly Sunday, July 19, 2009
  58. 58. projects using rufus-tokyo (github search) - wycats/moneta - jcrosby/cloudkit - elisehuard/tokyo_cabinet4r - terralien/metry - nofxx/tokyo_store - sethyates/content_manager - heycarsten/gcoder - joshbuddy/tokyo_cache_cow - ... Sunday, July 19, 2009
  59. 59. many thanks to Mikio Hirabayashi Zev Blut Ilya Grigorik Justin Reagor Flinn Muller Wayne E. Seguin Matthew King Yuki Satow Wayne Meissner Kim Erlandsen (picture) and many others Sunday, July 19, 2009

×