TokyoCabinet   TokyoTyrant                Copyright © Akira Koyasu. Some rights reserved.
Copyright © Akira Koyasu. Some rights reserved.
Copyright © Akira Koyasu. Some rights reserved.
Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet (TC)       DB            DB                    Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet (TC)       DB            DB                    Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet (TC)       DB            DBTokyoTyrant (TT) TC                    Copyright © Akira Koyasu. Some rights reser...
TokyoCabinet (TC)       DB            DBTokyoTyrant (TT) TC                    Copyright © Akira Koyasu. Some rights reser...
Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet        Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet✤               Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet       hash (.tch)          b+ tree (.tcb)    fixed-length (.tcf)           table (.tct)✤                      ...
TokyoCabinet    hash (.tch)    key      value             b+ tree (.tcb)    fixed-length (.tcf)              table (.tct)✤ ...
TokyoCabinet    hash (.tch)            b+ tree (.tcb)                                                               value1...
TokyoCabinet       hash (.tch)            b+ tree (.tcb)                                                                  ...
TokyoCabinet       hash (.tch)              b+ tree (.tcb)                                                                ...
TokyoCabinet       hash (.tch)              b+ tree (.tcb)                                                                ...
TokyoCabinet                     CLI✤                              x    h(ash) / b(+ tree) / f(ixed-length) / t(able)     ...
TokyoCabinet                     CLItcxmgr create /path/to/dbfile.tcx✤                              x    h(ash) / b(+ tree)...
TokyoCabinet                     CLItcxmgr create /path/to/dbfile.tcxtcxmgr put /path/to/dbfile.tcx key value✤              ...
TokyoCabinet                     CLItcxmgr create /path/to/dbfile.tcxtcxmgr put /path/to/dbfile.tcx key valuetcxmgr list /pa...
TokyoCabinet                     CLItcxmgr create /path/to/dbfile.tcxtcxmgr put /path/to/dbfile.tcx key valuetcxmgr list /pa...
TokyoCabinet                     CLItcxmgr create /path/to/dbfile.tcxtcxmgr put /path/to/dbfile.tcx key valuetcxmgr list /pa...
TokyoCabinetJavaAPI (JNI)            Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet                       JavaAPI (JNI)HDB hdb = new HDB();//            tchhdb.open("/path/to/test.tch", HDB.OCR...
Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant        Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant✤                              x    h(ash) / b(+ tree) / f(ixed-length) / t(able)                              ...
TokyoTyrant              ttserver /path/to/dbfile.tcx✤                              x    h(ash) / b(+ tree) / f(ixed-length...
TokyoTyrant              ttserver /path/to/dbfile.tcx              ^C✤                              x    h(ash) / b(+ tree)...
TokyoTyrant ClientCLI          Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant     ClientCLItcrmgr put host key value                Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant     ClientCLItcrmgr put host key valuetcrmgr list host                   Copyright © Akira Koyasu. Some rights...
TokyoTyrant     ClientCLItcrmgr put host key valuetcrmgr list hosttcrmgr get host key                   Copyright © Akira ...
TokyoTyrant     ClientCLItcrmgr put host key valuetcrmgr list hosttcrmgr get host keytcrmgr out host key                  ...
TokyoTyrant            ClientCLI  tcrmgr put host key value  tcrmgr list host  tcrmgr get host key  tcrmgr out host keyr=r...
TokyoTyrant  JavaAPI          Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant                         JavaAPIRDB rdb = new RDB();//                       TTrdb.open(new InetSocketAddress("...
TokyoTyrant          Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant          Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant          Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant          Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant          Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant-ulog                  Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant-ulogcopy                  Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant-ulogcopyDB      rts                    -rts                        Copyright © Akira Koyasu. Some rights reser...
NotesThis work is licensed under the Creative Commons Attribution-NonCommercial 3.0 Unported License. To view a copy of th...
Upcoming SlideShare
Loading in...5
×

Tokyo Cabinet & Tokyo Tyrant

3,868

Published on

First step guide of Tokyo Cabinet & Tokto Tyrant.

Published in: Technology, Business
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
3,868
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
27
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • cd ~/path/to/tokyoproducts\ntchmgr create dbfile.tch\ntchmgr put dbfile.tch "hoge" "fuga"tchmgr list dbfile.tch\ntchmgr get dbfile.tch "hoge"\ntchmgr out dbfile.tch "hoge"\nrm dbfile.tch\n
  • cd ~/path/to/tokyoproducts\ntchmgr create dbfile.tch\ntchmgr put dbfile.tch "hoge" "fuga"tchmgr list dbfile.tch\ntchmgr get dbfile.tch "hoge"\ntchmgr out dbfile.tch "hoge"\nrm dbfile.tch\n
  • cd ~/path/to/tokyoproducts\ntchmgr create dbfile.tch\ntchmgr put dbfile.tch "hoge" "fuga"tchmgr list dbfile.tch\ntchmgr get dbfile.tch "hoge"\ntchmgr out dbfile.tch "hoge"\nrm dbfile.tch\n
  • cd ~/path/to/tokyoproducts\ntchmgr create dbfile.tch\ntchmgr put dbfile.tch "hoge" "fuga"tchmgr list dbfile.tch\ntchmgr get dbfile.tch "hoge"\ntchmgr out dbfile.tch "hoge"\nrm dbfile.tch\n
  • cd ~/path/to/tokyoproducts\ntchmgr create dbfile.tch\ntchmgr put dbfile.tch "hoge" "fuga"tchmgr list dbfile.tch\ntchmgr get dbfile.tch "hoge"\ntchmgr out dbfile.tch "hoge"\nrm dbfile.tch\n
  • \n
  • \n
  • cd ~/path/to/tokyoproducts\nttserver dbfile.tch\n^C\n
  • cd ~/path/to/tokyoproducts\nttserver dbfile.tch\n^C\n
  • console1:$ cd ~/path/to/tokyoproducts\nconsole1:$ ttserver dbfile.tch\n\nconsole2:$ tcrmgr put localhost "hoge" "fuga"\nconsole2:$ tcrmgr put localhost "foo" "bar"\nconsole2:$ tcrmgr list localhost\nconsole2:$ tcrmgr get localhost "hoge"\nconsole2:$ tcrmgr out localhost "hoge"\n\nconsole1:$ ^C\nconsole1:$ tchmgr list dbfile.tch\n
  • console1:$ cd ~/path/to/tokyoproducts\nconsole1:$ ttserver dbfile.tch\n\nconsole2:$ tcrmgr put localhost "hoge" "fuga"\nconsole2:$ tcrmgr put localhost "foo" "bar"\nconsole2:$ tcrmgr list localhost\nconsole2:$ tcrmgr get localhost "hoge"\nconsole2:$ tcrmgr out localhost "hoge"\n\nconsole1:$ ^C\nconsole1:$ tchmgr list dbfile.tch\n
  • console1:$ cd ~/path/to/tokyoproducts\nconsole1:$ ttserver dbfile.tch\n\nconsole2:$ tcrmgr put localhost "hoge" "fuga"\nconsole2:$ tcrmgr put localhost "foo" "bar"\nconsole2:$ tcrmgr list localhost\nconsole2:$ tcrmgr get localhost "hoge"\nconsole2:$ tcrmgr out localhost "hoge"\n\nconsole1:$ ^C\nconsole1:$ tchmgr list dbfile.tch\n
  • console1:$ cd ~/path/to/tokyoproducts\nconsole1:$ ttserver dbfile.tch\n\nconsole2:$ tcrmgr put localhost "hoge" "fuga"\nconsole2:$ tcrmgr put localhost "foo" "bar"\nconsole2:$ tcrmgr list localhost\nconsole2:$ tcrmgr get localhost "hoge"\nconsole2:$ tcrmgr out localhost "hoge"\n\nconsole1:$ ^C\nconsole1:$ tchmgr list dbfile.tch\n
  • console1:$ cd ~/path/to/tokyoproducts\nconsole1:$ ttserver dbfile.tch\n\nconsole2:$ tcrmgr put localhost "hoge" "fuga"\nconsole2:$ tcrmgr put localhost "foo" "bar"\nconsole2:$ tcrmgr list localhost\nconsole2:$ tcrmgr get localhost "hoge"\nconsole2:$ tcrmgr out localhost "hoge"\n\nconsole1:$ ^C\nconsole1:$ tchmgr list dbfile.tch\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • console1:$ cd ~/path/to/tokyoproducts\nconsole1:$ mkdir ulog\nconsole1:$ ttserver -sid 1 -ulog ulog/ dbfile.tch\n\nconsole2:$ cd ~/path/to/tokyoproducts2\nconsole2:$ cat ttcopy.sh\nconsole2:$ tcrmgr copy localhost '@/path/to/tokyoproducts2/ttcopy.sh'\nconsole2:$ ls -l ~/path/to/tokyoproducts\nconsole2:$ mv ~/path/to/tokyoproducts/dbfile.tch.xxxx ./\nconsole2:$ echo xxxxx > slave.rts\nconsole2:$ mv dbfile.tch.xxxx dbfile.tch\nconsole2:$ ttserver -sid 2 -port 1979 -mhost localhost -mport 1978 -rts slave.rts dbfile.tch\n\nconsole3:$ tcrmgr list localhost\nconsole3:$ tcrmgr list -port 1979 localhost\nconsole3:$ tcrmgr put localhost "cto" "mukaihira"\nconsole3:$ tcrmgr get -port 1979 localhost "cto"\n
  • console1:$ cd ~/path/to/tokyoproducts\nconsole1:$ mkdir ulog\nconsole1:$ ttserver -sid 1 -ulog ulog/ dbfile.tch\n\nconsole2:$ cd ~/path/to/tokyoproducts2\nconsole2:$ cat ttcopy.sh\nconsole2:$ tcrmgr copy localhost '@/path/to/tokyoproducts2/ttcopy.sh'\nconsole2:$ ls -l ~/path/to/tokyoproducts\nconsole2:$ mv ~/path/to/tokyoproducts/dbfile.tch.xxxx ./\nconsole2:$ echo xxxxx > slave.rts\nconsole2:$ mv dbfile.tch.xxxx dbfile.tch\nconsole2:$ ttserver -sid 2 -port 1979 -mhost localhost -mport 1978 -rts slave.rts dbfile.tch\n\nconsole3:$ tcrmgr list localhost\nconsole3:$ tcrmgr list -port 1979 localhost\nconsole3:$ tcrmgr put localhost "cto" "mukaihira"\nconsole3:$ tcrmgr get -port 1979 localhost "cto"\n
  • console1:$ cd ~/path/to/tokyoproducts\nconsole1:$ mkdir ulog\nconsole1:$ ttserver -sid 1 -ulog ulog/ dbfile.tch\n\nconsole2:$ cd ~/path/to/tokyoproducts2\nconsole2:$ cat ttcopy.sh\nconsole2:$ tcrmgr copy localhost '@/path/to/tokyoproducts2/ttcopy.sh'\nconsole2:$ ls -l ~/path/to/tokyoproducts\nconsole2:$ mv ~/path/to/tokyoproducts/dbfile.tch.xxxx ./\nconsole2:$ echo xxxxx > slave.rts\nconsole2:$ mv dbfile.tch.xxxx dbfile.tch\nconsole2:$ ttserver -sid 2 -port 1979 -mhost localhost -mport 1978 -rts slave.rts dbfile.tch\n\nconsole3:$ tcrmgr list localhost\nconsole3:$ tcrmgr list -port 1979 localhost\nconsole3:$ tcrmgr put localhost "cto" "mukaihira"\nconsole3:$ tcrmgr get -port 1979 localhost "cto"\n
  • \n
  • Tokyo Cabinet & Tokyo Tyrant

    1. 1. TokyoCabinet TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
    2. 2. Copyright © Akira Koyasu. Some rights reserved.
    3. 3. Copyright © Akira Koyasu. Some rights reserved.
    4. 4. Copyright © Akira Koyasu. Some rights reserved.
    5. 5. TokyoCabinet (TC) DB DB Copyright © Akira Koyasu. Some rights reserved.
    6. 6. TokyoCabinet (TC) DB DB Copyright © Akira Koyasu. Some rights reserved.
    7. 7. TokyoCabinet (TC) DB DBTokyoTyrant (TT) TC Copyright © Akira Koyasu. Some rights reserved.
    8. 8. TokyoCabinet (TC) DB DBTokyoTyrant (TT) TC Copyright © Akira Koyasu. Some rights reserved.
    9. 9. Copyright © Akira Koyasu. Some rights reserved.
    10. 10. TokyoCabinet Copyright © Akira Koyasu. Some rights reserved.
    11. 11. TokyoCabinet✤ Copyright © Akira Koyasu. Some rights reserved.
    12. 12. TokyoCabinet hash (.tch) b+ tree (.tcb) fixed-length (.tcf) table (.tct)✤ Copyright © Akira Koyasu. Some rights reserved.
    13. 13. TokyoCabinet hash (.tch) key value b+ tree (.tcb) fixed-length (.tcf) table (.tct)✤ Copyright © Akira Koyasu. Some rights reserved.
    14. 14. TokyoCabinet hash (.tch) b+ tree (.tcb) value1 key value key value2 value3 fixed-length (.tcf) table (.tct)✤ Copyright © Akira Koyasu. Some rights reserved.
    15. 15. TokyoCabinet hash (.tch) b+ tree (.tcb) value1 key value key value2 value3 fixed-length (.tcf) table (.tct) key value✤ Copyright © Akira Koyasu. Some rights reserved.
    16. 16. TokyoCabinet hash (.tch) b+ tree (.tcb) value1 key value key value2 value3 fixed-length (.tcf) table (.tct) key valuenatural number max-length✤ Copyright © Akira Koyasu. Some rights reserved.
    17. 17. TokyoCabinet hash (.tch) b+ tree (.tcb) value1 key value key value2 value3 fixed-length (.tcf) table (.tct) name1 value1 name2 key value key value2natural number max-length name3 value1✤ Copyright © Akira Koyasu. Some rights reserved.
    18. 18. TokyoCabinet CLI✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
    19. 19. TokyoCabinet CLItcxmgr create /path/to/dbfile.tcx✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
    20. 20. TokyoCabinet CLItcxmgr create /path/to/dbfile.tcxtcxmgr put /path/to/dbfile.tcx key value✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
    21. 21. TokyoCabinet CLItcxmgr create /path/to/dbfile.tcxtcxmgr put /path/to/dbfile.tcx key valuetcxmgr list /path/to/dbfile.tcx✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
    22. 22. TokyoCabinet CLItcxmgr create /path/to/dbfile.tcxtcxmgr put /path/to/dbfile.tcx key valuetcxmgr list /path/to/dbfile.tcxtcxmgr get /path/to/dbfile.tcx key✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
    23. 23. TokyoCabinet CLItcxmgr create /path/to/dbfile.tcxtcxmgr put /path/to/dbfile.tcx key valuetcxmgr list /path/to/dbfile.tcxtcxmgr get /path/to/dbfile.tcx keytcxmgr out /path/to/dbfile.tcx key✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
    24. 24. TokyoCabinetJavaAPI (JNI) Copyright © Akira Koyasu. Some rights reserved.
    25. 25. TokyoCabinet JavaAPI (JNI)HDB hdb = new HDB();// tchhdb.open("/path/to/test.tch", HDB.OCREAT | HDB.OWRITER);hdb.put("hoge", "fuga"); //hdb.get("hoge"); //hdb.out("hoge"); //hdb.close(); // Copyright © Akira Koyasu. Some rights reserved.
    26. 26. Copyright © Akira Koyasu. Some rights reserved.
    27. 27. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
    28. 28. TokyoTyrant✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
    29. 29. TokyoTyrant ttserver /path/to/dbfile.tcx✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
    30. 30. TokyoTyrant ttserver /path/to/dbfile.tcx ^C✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
    31. 31. TokyoTyrant ClientCLI Copyright © Akira Koyasu. Some rights reserved.
    32. 32. TokyoTyrant ClientCLItcrmgr put host key value Copyright © Akira Koyasu. Some rights reserved.
    33. 33. TokyoTyrant ClientCLItcrmgr put host key valuetcrmgr list host Copyright © Akira Koyasu. Some rights reserved.
    34. 34. TokyoTyrant ClientCLItcrmgr put host key valuetcrmgr list hosttcrmgr get host key Copyright © Akira Koyasu. Some rights reserved.
    35. 35. TokyoTyrant ClientCLItcrmgr put host key valuetcrmgr list hosttcrmgr get host keytcrmgr out host key Copyright © Akira Koyasu. Some rights reserved.
    36. 36. TokyoTyrant ClientCLI tcrmgr put host key value tcrmgr list host tcrmgr get host key tcrmgr out host keyr=remote Copyright © Akira Koyasu. Some rights reserved.
    37. 37. TokyoTyrant JavaAPI Copyright © Akira Koyasu. Some rights reserved.
    38. 38. TokyoTyrant JavaAPIRDB rdb = new RDB();// TTrdb.open(new InetSocketAddress("localhost", 1978));rdb.put("hoge", "fuga"); //rdb.get("hoge"); //rdb.out("hoge"); //rdb.close(); // Copyright © Akira Koyasu. Some rights reserved.
    39. 39. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
    40. 40. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
    41. 41. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
    42. 42. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
    43. 43. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
    44. 44. TokyoTyrant-ulog Copyright © Akira Koyasu. Some rights reserved.
    45. 45. TokyoTyrant-ulogcopy Copyright © Akira Koyasu. Some rights reserved.
    46. 46. TokyoTyrant-ulogcopyDB rts -rts Copyright © Akira Koyasu. Some rights reserved.
    47. 47. NotesThis work is licensed under the Creative Commons Attribution-NonCommercial 3.0 Unported License. To view a copy of thislicense, visit http://creativecommons.org/licenses/by-nc/3.0/.Tokyo Cabinet was written and is maintained by FAL Labs: http://fallabs.com/tokyocabinet/Tokyo Tyrant was written and is maintained by FAL Labs: http://fallabs.com/tokyotyrant/Page1 photo from: http://www.flickr.com/photos/batardy_sebastien/4092898500/ Copyright © Akira Koyasu. Some rights reserved.
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×