SlideShare a Scribd company logo
1 of 47
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
            DB



TokyoTyrant (TT)

 TC




                    Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet (TC)

       DB
            DB



TokyoTyrant (TT)

 TC




                    Copyright © Akira Koyasu. Some rights reserved.
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)




✤

                             Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet


    hash (.tch)

    key      value             b+ tree (.tcb)




    fixed-length (.tcf)              table (.tct)




✤

                                Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet


    hash (.tch)            b+ tree (.tcb)
                                                               value1

    key      value            key                                 value2

                                                               value3




    fixed-length (.tcf)                table (.tct)




✤

                                    Copyright © Akira Koyasu. Some rights reserved.
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.
TokyoCabinet


       hash (.tch)              b+ tree (.tcb)
                                                                    value1

      key         value            key                                 value2

                                                                    value3



    fixed-length (.tcf)
                                           table (.tct)
      key         value

natural number   max-length


✤

                                         Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet


       hash (.tch)              b+ tree (.tcb)
                                                                     value1

      key         value            key                                  value2

                                                                     value3



    fixed-length (.tcf)          table (.tct)                 name1
                                                                   value1

                                                                        name2
      key         value             key
                                                                              value2
natural number   max-length                                 name3
                                                                  value1
✤

                                          Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet
                     CLI




✤                              x
    h(ash) / b(+ tree) / f(ixed-length) / t(able)

                                         Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet
                     CLI

tcxmgr create /path/to/dbfile.tcx




✤                              x
    h(ash) / b(+ tree) / f(ixed-length) / t(able)

                                         Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet
                     CLI

tcxmgr create /path/to/dbfile.tcx

tcxmgr put /path/to/dbfile.tcx key value




✤                              x
    h(ash) / b(+ tree) / f(ixed-length) / t(able)

                                         Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet
                     CLI

tcxmgr create /path/to/dbfile.tcx

tcxmgr put /path/to/dbfile.tcx key value

tcxmgr list /path/to/dbfile.tcx




✤                              x
    h(ash) / b(+ tree) / f(ixed-length) / t(able)

                                         Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet
                     CLI

tcxmgr create /path/to/dbfile.tcx

tcxmgr put /path/to/dbfile.tcx key value

tcxmgr list /path/to/dbfile.tcx

tcxmgr get /path/to/dbfile.tcx key



✤                              x
    h(ash) / b(+ tree) / f(ixed-length) / t(able)

                                         Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet
                     CLI

tcxmgr create /path/to/dbfile.tcx

tcxmgr put /path/to/dbfile.tcx key value

tcxmgr list /path/to/dbfile.tcx

tcxmgr get /path/to/dbfile.tcx key

tcxmgr out /path/to/dbfile.tcx key

✤                              x
    h(ash) / b(+ tree) / f(ixed-length) / t(able)

                                         Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet
JavaAPI (JNI)




            Copyright © Akira Koyasu. Some rights reserved.
TokyoCabinet
                       JavaAPI (JNI)


HDB hdb = new HDB();

//            tch

hdb.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.
Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant



        Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant




✤                              x
    h(ash) / b(+ tree) / f(ixed-length) / t(able)



                                         Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant




              ttserver /path/to/dbfile.tcx




✤                              x
    h(ash) / b(+ tree) / f(ixed-length) / t(able)



                                         Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant




              ttserver /path/to/dbfile.tcx

              ^C




✤                              x
    h(ash) / b(+ tree) / f(ixed-length) / t(able)



                                         Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant
 ClientCLI




          Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant
     ClientCLI


tcrmgr put host key value




                Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant
     ClientCLI


tcrmgr put host key value

tcrmgr list host




                   Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant
     ClientCLI


tcrmgr put host key value

tcrmgr list host

tcrmgr get host key




                   Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant
     ClientCLI


tcrmgr put host key value

tcrmgr list host

tcrmgr get host key

tcrmgr out host key




                   Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant
            ClientCLI


  tcrmgr put host key value

  tcrmgr list host

  tcrmgr get host key

  tcrmgr out host key


r=remote



                     Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant
  JavaAPI




          Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant
                         JavaAPI


RDB rdb = new RDB();

//                       TT

rdb.open(new InetSocketAddress("localhost", 1978));

rdb.put("hoge", "fuga");	//

rdb.get("hoge");	 	 //

rdb.out("hoge");	 	 //

rdb.close();	 //
             	




                                    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




          Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant




-ulog




                  Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant




-ulog



copy




                  Copyright © Akira Koyasu. Some rights reserved.
TokyoTyrant




-ulog



copy



DB      rts                    -rts



                        Copyright © Akira Koyasu. Some rights reserved.
Notes

This work is licensed under the Creative Commons Attribution-
NonCommercial 3.0 Unported License. To view a copy of this
license, 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.

More Related Content

What's hot

Jvm lecture
Jvm lectureJvm lecture
Jvm lecture
sdslnmd
 
Guide for visualizing JMA's GSM outputs using GrADS
Guide for visualizing JMA's GSM outputs using GrADSGuide for visualizing JMA's GSM outputs using GrADS
Guide for visualizing JMA's GSM outputs using GrADS
JMA_447
 

What's hot (20)

Start Wrap Episode 11: A New Rope
Start Wrap Episode 11: A New RopeStart Wrap Episode 11: A New Rope
Start Wrap Episode 11: A New Rope
 
Jvm lecture
Jvm lectureJvm lecture
Jvm lecture
 
Java 어플리케이션 성능튜닝 Part1
Java 어플리케이션 성능튜닝 Part1Java 어플리케이션 성능튜닝 Part1
Java 어플리케이션 성능튜닝 Part1
 
Choosing the right high availability strategy
Choosing the right high availability strategyChoosing the right high availability strategy
Choosing the right high availability strategy
 
Supporting HDF5 in GrADS
Supporting HDF5 in GrADSSupporting HDF5 in GrADS
Supporting HDF5 in GrADS
 
Python VS GO
Python VS GOPython VS GO
Python VS GO
 
Understanding Garbage Collection
Understanding Garbage CollectionUnderstanding Garbage Collection
Understanding Garbage Collection
 
Time Series Processing with Solr and Spark
Time Series Processing with Solr and SparkTime Series Processing with Solr and Spark
Time Series Processing with Solr and Spark
 
Cacheconcurrencyconsistency cassandra svcc
Cacheconcurrencyconsistency cassandra svccCacheconcurrencyconsistency cassandra svcc
Cacheconcurrencyconsistency cassandra svcc
 
Go at uber
Go at uberGo at uber
Go at uber
 
MapReduce - Basics | Big Data Hadoop Spark Tutorial | CloudxLab
MapReduce - Basics | Big Data Hadoop Spark Tutorial | CloudxLabMapReduce - Basics | Big Data Hadoop Spark Tutorial | CloudxLab
MapReduce - Basics | Big Data Hadoop Spark Tutorial | CloudxLab
 
FOSDEM 2020: Querying over millions and billions of metrics with M3DB's index
FOSDEM 2020: Querying over millions and billions of metrics with M3DB's indexFOSDEM 2020: Querying over millions and billions of metrics with M3DB's index
FOSDEM 2020: Querying over millions and billions of metrics with M3DB's index
 
Functional, Type-safe, Testable Microservices with ZIO and gRPC
Functional, Type-safe, Testable Microservices with ZIO and gRPCFunctional, Type-safe, Testable Microservices with ZIO and gRPC
Functional, Type-safe, Testable Microservices with ZIO and gRPC
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
 
mesos-devoxx14
mesos-devoxx14mesos-devoxx14
mesos-devoxx14
 
Groovy.pptx
Groovy.pptxGroovy.pptx
Groovy.pptx
 
Новый InterSystems: open-source, митапы, хакатоны
Новый InterSystems: open-source, митапы, хакатоныНовый InterSystems: open-source, митапы, хакатоны
Новый InterSystems: open-source, митапы, хакатоны
 
Guide for visualizing JMA's GSM outputs using GrADS
Guide for visualizing JMA's GSM outputs using GrADSGuide for visualizing JMA's GSM outputs using GrADS
Guide for visualizing JMA's GSM outputs using GrADS
 
Conda environment system & how to use it on CSUC machines
Conda environment system & how to use it on CSUC machinesConda environment system & how to use it on CSUC machines
Conda environment system & how to use it on CSUC machines
 
Improving go-git performance
Improving go-git performanceImproving go-git performance
Improving go-git performance
 

Viewers also liked

インフラエンジニアのためのcassandra入門
インフラエンジニアのためのcassandra入門インフラエンジニアのためのcassandra入門
インフラエンジニアのためのcassandra入門
Akihiro Kuwano
 
AWS Summit 2011: Data Storage Solutions in the AWS Cloud
AWS Summit 2011: Data Storage Solutions in the AWS CloudAWS Summit 2011: Data Storage Solutions in the AWS Cloud
AWS Summit 2011: Data Storage Solutions in the AWS Cloud
Amazon Web Services
 

Viewers also liked (20)

インフラエンジニアのためのcassandra入門
インフラエンジニアのためのcassandra入門インフラエンジニアのためのcassandra入門
インフラエンジニアのためのcassandra入門
 
Lean & Mean Tokyo Cabinet Recipes (with Lua) - FutureRuby '09
Lean & Mean Tokyo Cabinet Recipes (with Lua) - FutureRuby '09Lean & Mean Tokyo Cabinet Recipes (with Lua) - FutureRuby '09
Lean & Mean Tokyo Cabinet Recipes (with Lua) - FutureRuby '09
 
tokyotalk
tokyotalktokyotalk
tokyotalk
 
Tokyo Cabinet
Tokyo CabinetTokyo Cabinet
Tokyo Cabinet
 
Tokyocabinet
TokyocabinetTokyocabinet
Tokyocabinet
 
SSDとTokyoTyrantやMySQLの性能検証
SSDとTokyoTyrantやMySQLの性能検証SSDとTokyoTyrantやMySQLの性能検証
SSDとTokyoTyrantやMySQLの性能検証
 
AWS Tech Summit - Berlin 2011 - Choosing and Running Databases on AWS
AWS Tech Summit - Berlin 2011 - Choosing and Running Databases on AWSAWS Tech Summit - Berlin 2011 - Choosing and Running Databases on AWS
AWS Tech Summit - Berlin 2011 - Choosing and Running Databases on AWS
 
Tokyo Cabinet
Tokyo CabinetTokyo Cabinet
Tokyo Cabinet
 
AWS Summit 2011: Data Storage Solutions in the AWS Cloud
AWS Summit 2011: Data Storage Solutions in the AWS CloudAWS Summit 2011: Data Storage Solutions in the AWS Cloud
AWS Summit 2011: Data Storage Solutions in the AWS Cloud
 
ASAMAP 開発秘話
ASAMAP 開発秘話ASAMAP 開発秘話
ASAMAP 開発秘話
 
Redmineを快適に使うためのおすすめ初期設定
Redmineを快適に使うためのおすすめ初期設定Redmineを快適に使うためのおすすめ初期設定
Redmineを快適に使うためのおすすめ初期設定
 
Nosqlの基礎知識(2013年7月講義資料)
Nosqlの基礎知識(2013年7月講義資料)Nosqlの基礎知識(2013年7月講義資料)
Nosqlの基礎知識(2013年7月講義資料)
 
On the benchmark of Chainer
On the benchmark of ChainerOn the benchmark of Chainer
On the benchmark of Chainer
 
Deep parking
Deep parkingDeep parking
Deep parking
 
深層学習ライブラリの環境問題Chainer Meetup2016 07-02
深層学習ライブラリの環境問題Chainer Meetup2016 07-02深層学習ライブラリの環境問題Chainer Meetup2016 07-02
深層学習ライブラリの環境問題Chainer Meetup2016 07-02
 
ヤフー音声認識サービスでのディープラーニングとGPU利用事例
ヤフー音声認識サービスでのディープラーニングとGPU利用事例ヤフー音声認識サービスでのディープラーニングとGPU利用事例
ヤフー音声認識サービスでのディープラーニングとGPU利用事例
 
俺のtensorが全然flowしないのでみんなchainer使おう by DEEPstation
俺のtensorが全然flowしないのでみんなchainer使おう by DEEPstation俺のtensorが全然flowしないのでみんなchainer使おう by DEEPstation
俺のtensorが全然flowしないのでみんなchainer使おう by DEEPstation
 
マシンパーセプション研究におけるChainer活用事例
マシンパーセプション研究におけるChainer活用事例マシンパーセプション研究におけるChainer活用事例
マシンパーセプション研究におけるChainer活用事例
 
Chainer Update v1.8.0 -> v1.10.0+
Chainer Update v1.8.0 -> v1.10.0+Chainer Update v1.8.0 -> v1.10.0+
Chainer Update v1.8.0 -> v1.10.0+
 
Chainer, Cupy入門
Chainer, Cupy入門Chainer, Cupy入門
Chainer, Cupy入門
 

More from 輝 子安

More from 輝 子安 (13)

Protractor under the hood
Protractor under the hoodProtractor under the hood
Protractor under the hood
 
そろそろLambda(CI/CD編)
そろそろLambda(CI/CD編)そろそろLambda(CI/CD編)
そろそろLambda(CI/CD編)
 
Dockerで構成するWebサービス 〜EmotionTechの場合〜
Dockerで構成するWebサービス 〜EmotionTechの場合〜Dockerで構成するWebサービス 〜EmotionTechの場合〜
Dockerで構成するWebサービス 〜EmotionTechの場合〜
 
Workshop: Docker on Elastic Beanstalk
Workshop: Docker on Elastic BeanstalkWorkshop: Docker on Elastic Beanstalk
Workshop: Docker on Elastic Beanstalk
 
PHP conference 2013 ja report
PHP conference 2013 ja reportPHP conference 2013 ja report
PHP conference 2013 ja report
 
Scala for Java programmers
Scala for Java programmersScala for Java programmers
Scala for Java programmers
 
Garbage Collection for Dummies
Garbage Collection for DummiesGarbage Collection for Dummies
Garbage Collection for Dummies
 
JavaOne Guide for the Petite Bourgeoisie
JavaOne Guide for the Petite BourgeoisieJavaOne Guide for the Petite Bourgeoisie
JavaOne Guide for the Petite Bourgeoisie
 
Java, Moving Forward
Java, Moving ForwardJava, Moving Forward
Java, Moving Forward
 
Java, Up to Date
Java, Up to DateJava, Up to Date
Java, Up to Date
 
Java, Up to Date Sources
Java, Up to Date SourcesJava, Up to Date Sources
Java, Up to Date Sources
 
Hello, Guava ! samples
Hello, Guava ! samplesHello, Guava ! samples
Hello, Guava ! samples
 
Hello, Guava !
Hello, Guava !Hello, Guava !
Hello, Guava !
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Tokyo Cabinet & Tokyo Tyrant

  • 1. TokyoCabinet TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
  • 2. Copyright © Akira Koyasu. Some rights reserved.
  • 3. Copyright © Akira Koyasu. Some rights reserved.
  • 4. Copyright © Akira Koyasu. Some rights reserved.
  • 5. TokyoCabinet (TC) DB DB Copyright © Akira Koyasu. Some rights reserved.
  • 6. TokyoCabinet (TC) DB DB Copyright © Akira Koyasu. Some rights reserved.
  • 7. TokyoCabinet (TC) DB DB TokyoTyrant (TT) TC Copyright © Akira Koyasu. Some rights reserved.
  • 8. TokyoCabinet (TC) DB DB TokyoTyrant (TT) TC Copyright © Akira Koyasu. Some rights reserved.
  • 9. Copyright © Akira Koyasu. Some rights reserved.
  • 10. TokyoCabinet Copyright © Akira Koyasu. Some rights reserved.
  • 11. TokyoCabinet ✤ Copyright © Akira Koyasu. Some rights reserved.
  • 12. TokyoCabinet hash (.tch) b+ tree (.tcb) fixed-length (.tcf) table (.tct) ✤ Copyright © Akira Koyasu. Some rights reserved.
  • 13. TokyoCabinet hash (.tch) key value b+ tree (.tcb) fixed-length (.tcf) table (.tct) ✤ Copyright © Akira Koyasu. Some rights reserved.
  • 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. 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. TokyoCabinet hash (.tch) b+ tree (.tcb) value1 key value key value2 value3 fixed-length (.tcf) table (.tct) key value natural number max-length ✤ Copyright © Akira Koyasu. Some rights reserved.
  • 17. TokyoCabinet hash (.tch) b+ tree (.tcb) value1 key value key value2 value3 fixed-length (.tcf) table (.tct) name1 value1 name2 key value key value2 natural number max-length name3 value1 ✤ Copyright © Akira Koyasu. Some rights reserved.
  • 18. TokyoCabinet CLI ✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
  • 19. TokyoCabinet CLI tcxmgr create /path/to/dbfile.tcx ✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
  • 20. TokyoCabinet CLI tcxmgr create /path/to/dbfile.tcx tcxmgr put /path/to/dbfile.tcx key value ✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
  • 21. TokyoCabinet CLI tcxmgr create /path/to/dbfile.tcx tcxmgr put /path/to/dbfile.tcx key value tcxmgr list /path/to/dbfile.tcx ✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
  • 22. TokyoCabinet CLI tcxmgr create /path/to/dbfile.tcx tcxmgr put /path/to/dbfile.tcx key value tcxmgr list /path/to/dbfile.tcx tcxmgr get /path/to/dbfile.tcx key ✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
  • 23. TokyoCabinet CLI tcxmgr create /path/to/dbfile.tcx tcxmgr put /path/to/dbfile.tcx key value tcxmgr list /path/to/dbfile.tcx tcxmgr get /path/to/dbfile.tcx key tcxmgr out /path/to/dbfile.tcx key ✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
  • 24. TokyoCabinet JavaAPI (JNI) Copyright © Akira Koyasu. Some rights reserved.
  • 25. TokyoCabinet JavaAPI (JNI) HDB hdb = new HDB(); // tch hdb.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. Copyright © Akira Koyasu. Some rights reserved.
  • 27. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
  • 28. TokyoTyrant ✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
  • 29. TokyoTyrant ttserver /path/to/dbfile.tcx ✤ x h(ash) / b(+ tree) / f(ixed-length) / t(able) Copyright © Akira Koyasu. Some rights reserved.
  • 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. TokyoTyrant ClientCLI Copyright © Akira Koyasu. Some rights reserved.
  • 32. TokyoTyrant ClientCLI tcrmgr put host key value Copyright © Akira Koyasu. Some rights reserved.
  • 33. TokyoTyrant ClientCLI tcrmgr put host key value tcrmgr list host Copyright © Akira Koyasu. Some rights reserved.
  • 34. TokyoTyrant ClientCLI tcrmgr put host key value tcrmgr list host tcrmgr get host key Copyright © Akira Koyasu. Some rights reserved.
  • 35. TokyoTyrant ClientCLI tcrmgr put host key value tcrmgr list host tcrmgr get host key tcrmgr out host key Copyright © Akira Koyasu. Some rights reserved.
  • 36. TokyoTyrant ClientCLI tcrmgr put host key value tcrmgr list host tcrmgr get host key tcrmgr out host key r=remote Copyright © Akira Koyasu. Some rights reserved.
  • 37. TokyoTyrant JavaAPI Copyright © Akira Koyasu. Some rights reserved.
  • 38. TokyoTyrant JavaAPI RDB rdb = new RDB(); // TT rdb.open(new InetSocketAddress("localhost", 1978)); rdb.put("hoge", "fuga"); // rdb.get("hoge"); // rdb.out("hoge"); // rdb.close(); // Copyright © Akira Koyasu. Some rights reserved.
  • 39. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
  • 40. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
  • 41. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
  • 42. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
  • 43. TokyoTyrant Copyright © Akira Koyasu. Some rights reserved.
  • 44. TokyoTyrant -ulog Copyright © Akira Koyasu. Some rights reserved.
  • 45. TokyoTyrant -ulog copy Copyright © Akira Koyasu. Some rights reserved.
  • 46. TokyoTyrant -ulog copy DB rts -rts Copyright © Akira Koyasu. Some rights reserved.
  • 47. Notes This work is licensed under the Creative Commons Attribution- NonCommercial 3.0 Unported License. To view a copy of this license, 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.

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. 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
  44. 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
  45. 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
  46. 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
  47. 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
  48. \n
  49. \n
  50. cd ~/path/to/tokyoproducts\nttserver dbfile.tch\n^C\n
  51. cd ~/path/to/tokyoproducts\nttserver dbfile.tch\n^C\n
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. 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
  63. 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
  64. 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
  65. \n