SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Tokyo Tyrant + PHP

    小山健一郎
Agenda
   • About Me
   • About Tokyo Tyrant
   • Tokyo Tyrant + PHP
   • Simple Benchmark




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   2
About Me




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   3
About Me
   • name:
       –小山健一郎 (id:k1LoW)
        •from Fukuoka
   • type:
       –PHPer, CakePHP baker, Emacser
   • membership:
     –Fusic Co.,Ltd
           • >> http://fusic.co.jp
       –codecheck.in
          • >> http://trac.codecheck.in
   and 101000code / 3rdSTONE


PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   4
PHPといえば*AMP
                             PHP = *AMP?




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   5
PostgreSQL




     ちなみに私はLAPPが好きです
                               I like LAPP




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   6
RDBMもいいけれど
     key/value型DBMも使ってみたい!
                                 I like RBMS.
                    But,I want to use key/value DBM too.




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.      7
About Tokyo Tyrant




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   8
Tokyo Tyrant (TT)
   • Tokyo Tyrant is network interface of Tokyo
     Cabinet (key/value DB library)
           –   http://tokyocabinet.sourceforge.net/tyrantdoc/




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.           9
Tokyo Tyrant (TT)
   • Tokyo Cabinet (TC)というkey/value型DBMの
     ネットワークインターフェース
       – Author:平林幹雄氏
       – http://tokyocabinet.sourceforge.net/tyrantdoc/


   • mixiの「最終ログイン」などを管理(しているらしい)
       – ↑ユーザがアクセスするたびに更新されるという高負荷


   • TCP/IP上からバイナリプロトコルで接続可能
       – memcachedのプロトコルにも対応
       – HTTP互換
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.     10
PHPからTokyo Tyrantを使いたい!
                 I want to use Tokyo Tyrant with PHP!




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   11
Tokyo Tyrant + PHP




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   12
Tokyo Tyrant + PHP
   TT+PHPを実現するInterfaceや
    PHP Extensionは見つけているも
      のだけで4つ
       –TT独自バイナリプロトコルを扱うもの
        のみ
       –memcached互換のものは今回は除く



PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   13
Net_TokyoTyrant




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   14
Net_TokyoTyrant
   • Author
       –個々一番氏(id:cocoiti)
   • feature
       –PurePHPライブラリ
       –Openpearにてリポジトリ管理
           • http://openpear.org/package/Net_TokyoTyrant

       –PurePHPとして最適化されている
       –おそらく最も有名(だと思う)
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.      15
インストール
                                 Install




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   16
$sudo pear install openpear/Net_TokyoTyrant-beta




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   17
簡単
                                 Easy




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   18
php-tokyo_tyrant
   • Author
       –Mikko Koppanen氏 (mkoppanen)
   • feature
       –PHP Extension
       –PECLに登録されている
         • PHP Manualもある
       –GitHubにてリポジトリ管理
           • http://github.com/mkoppanen/php-tokyo_tyrant/tree/
             master
       –最も活発に開発が進んでいる
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.             19
インストール
                                 Install




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   20
$sudo pecl install tokyo_tyrant-beta




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   21
簡単
                                 Easy




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   22
dbo_tokyo
   • Author
       –Martin Samson氏 (masom)
   • feature
       –Datasource for CakePHP
        thechawにてリポジトリ管理
           • http://thechaw.com/tokyotyrant_datasource




                               ※#cakephp@irc.codecheck.in:6667で
                               id:cakephperさんに教えてもらいました

PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.             23
tokyotyrant_php
   • Author
       –俺
   • feature
       –tokyotyrant.rbに、できるだけ近づけ
        た実装を目指している
       –Net_TokyoTyrantを参考に作成
         • Fork?
       –GitHubにてリポジトリ管理
           • http://github.com/k1LoW/tokyotyrant_php/tree/master
       –最もβ、むしろα

PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.              24
Simple Benchmark




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   25
※参考程度に考えてください
                          It's very simple ^^;




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   26
PHPなのでhttp://で
                  アクセスしてみた
                   Simple HTTP Access Benchmark




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   27
Simple Benchmark
   • 単純にApache Benchで計測して
     みた               ランダムなkeyで
                                                        クエリ発行
                     ab –n 1000 – c 100




                                         •Apache
     対象データ:
     sha1($i)をkey、$iをvalueとした            •mod_php
     1,000,000レコード
                                         •DBM
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.           28
1アクセス1クエリ
                                ※Request/sec相対
                           1 access 1 query




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   29
1アクセス1クエリ




Net_TokyoTyrant           dbo_tokyo                  MySQL   plane html
           php-tokyo_tyrant        tokyotyrant_php


                                                ※Request/sec相対
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.                 30
1アクセス100クエリ
                                ※Request/sec相対
                          1 access 100 query




PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   31
1アクセス100クエリ



                                                         !



Net_TokyoTyrant           dbo_tokyo                  MySQL   plane html
           php-tokyo_tyrant        tokyotyrant_php


                                                ※Request/sec相対
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.                 32
まとめ
   • Tokyo Tyrant + PHPの紹介をしま
     した。
   • php-tokyo_tyrantが最も高速
           –   php-tokyo_tyrant = very fast

   • PurePHPならNet_TokyoTyrant
           –   Net_TokyoTyrant = Nice PurePHP library

   • CakePHPならdbo_tokyo
           –   dbo_tokyo = CakePHP use

   • tokyotyrant_phpは…?
PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd.   33

Más contenido relacionado

Destacado

Destacado (16)

Fantasticno
FantasticnoFantasticno
Fantasticno
 
CakePHPゆとり開発環境
CakePHPゆとり開発環境CakePHPゆとり開発環境
CakePHPゆとり開発環境
 
Yet Another Plugins
Yet Another PluginsYet Another Plugins
Yet Another Plugins
 
Fukuoka Emacs #X02
Fukuoka Emacs #X02Fukuoka Emacs #X02
Fukuoka Emacs #X02
 
Emacs Lisp 紹介
Emacs Lisp 紹介Emacs Lisp 紹介
Emacs Lisp 紹介
 
Fantasticno W
Fantasticno WFantasticno W
Fantasticno W
 
Nature
NatureNature
Nature
 
はじめてのanything-c-source-*
はじめてのanything-c-source-*はじめてのanything-c-source-*
はじめてのanything-c-source-*
 
Jessie's 60th
Jessie's 60thJessie's 60th
Jessie's 60th
 
anything-php-funcref-perl.el
anything-php-funcref-perl.elanything-php-funcref-perl.el
anything-php-funcref-perl.el
 
for JSDeferred Code Reading
for JSDeferred Code Readingfor JSDeferred Code Reading
for JSDeferred Code Reading
 
CakePHP DB Schema/Model Info Plugin
CakePHP DB Schema/Model Info PluginCakePHP DB Schema/Model Info Plugin
CakePHP DB Schema/Model Info Plugin
 
A dash of creativity
A dash of creativityA dash of creativity
A dash of creativity
 
git-svn intro
git-svn introgit-svn intro
git-svn intro
 
実"戦"CakePHP Plugin
実"戦"CakePHP Plugin実"戦"CakePHP Plugin
実"戦"CakePHP Plugin
 
CakePHP Console Application 拡張Tips
CakePHP Console Application 拡張TipsCakePHP Console Application 拡張Tips
CakePHP Console Application 拡張Tips
 

Similar a Tokyo Tyrant + PHP

Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 TokyoCorporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 TokyoYusuke Kawasaki
 
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...devsumi2009
 
20090214 Phpstudy
20090214 Phpstudy20090214 Phpstudy
20090214 PhpstudyYusuke Ando
 
Linguagens Dinamicas - Tech Days 2008
Linguagens Dinamicas - Tech Days 2008Linguagens Dinamicas - Tech Days 2008
Linguagens Dinamicas - Tech Days 2008Alcides Fonseca
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Ivo Jansch
 
Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPPStoyan Zhekov
 
Hoppyではじめよう!リアルタイムweb
Hoppyではじめよう!リアルタイムwebHoppyではじめよう!リアルタイムweb
Hoppyではじめよう!リアルタイムwebtakeshi miki
 
PHPで文字コードとエラーメッセージをコントロールする
PHPで文字コードとエラーメッセージをコントロールするPHPで文字コードとエラーメッセージをコントロールする
PHPで文字コードとエラーメッセージをコントロールするSotaro Omura
 
Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Combell NV
 
Pylons + Tokyo Cabinet
Pylons + Tokyo CabinetPylons + Tokyo Cabinet
Pylons + Tokyo CabinetBen Cheng
 
Yakiniku(焼き肉) on the Cloud
Yakiniku(焼き肉) on the CloudYakiniku(焼き肉) on the Cloud
Yakiniku(焼き肉) on the CloudTakao Funami
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Ivo Jansch
 
How To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPHow To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPAtsuhiro Kubo
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)Stefan Koopmanschap
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909Yusuke Wada
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
2007 0822 Antelope Php
2007 0822 Antelope Php2007 0822 Antelope Php
2007 0822 Antelope Phpgmaxsonic
 
第1回PHP拡張勉強会
第1回PHP拡張勉強会第1回PHP拡張勉強会
第1回PHP拡張勉強会Ippei Ogiwara
 

Similar a Tokyo Tyrant + PHP (20)

Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 TokyoCorporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
 
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
 
20090214 Phpstudy
20090214 Phpstudy20090214 Phpstudy
20090214 Phpstudy
 
Linguagens Dinamicas - Tech Days 2008
Linguagens Dinamicas - Tech Days 2008Linguagens Dinamicas - Tech Days 2008
Linguagens Dinamicas - Tech Days 2008
 
Ribbit
RibbitRibbit
Ribbit
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008
 
Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPP
 
Hoppyではじめよう!リアルタイムweb
Hoppyではじめよう!リアルタイムwebHoppyではじめよう!リアルタイムweb
Hoppyではじめよう!リアルタイムweb
 
PHPで文字コードとエラーメッセージをコントロールする
PHPで文字コードとエラーメッセージをコントロールするPHPで文字コードとエラーメッセージをコントロールする
PHPで文字コードとエラーメッセージをコントロールする
 
Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...Professional PHP: an open-source alternative for enterprise development [Kort...
Professional PHP: an open-source alternative for enterprise development [Kort...
 
Pylons + Tokyo Cabinet
Pylons + Tokyo CabinetPylons + Tokyo Cabinet
Pylons + Tokyo Cabinet
 
Yakiniku(焼き肉) on the Cloud
Yakiniku(焼き肉) on the CloudYakiniku(焼き肉) on the Cloud
Yakiniku(焼き肉) on the Cloud
 
Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)Enterprise PHP (php|works 2008)
Enterprise PHP (php|works 2008)
 
How To Create Custom DSLs By PHP
How To Create Custom DSLs By PHPHow To Create Custom DSLs By PHP
How To Create Custom DSLs By PHP
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Becoming A Php Ninja
Becoming A Php NinjaBecoming A Php Ninja
Becoming A Php Ninja
 
2007 0822 Antelope Php
2007 0822 Antelope Php2007 0822 Antelope Php
2007 0822 Antelope Php
 
第1回PHP拡張勉強会
第1回PHP拡張勉強会第1回PHP拡張勉強会
第1回PHP拡張勉強会
 

Último

Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...itnewsafrica
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 

Último (20)

Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 

Tokyo Tyrant + PHP

  • 1. Tokyo Tyrant + PHP 小山健一郎
  • 2. Agenda • About Me • About Tokyo Tyrant • Tokyo Tyrant + PHP • Simple Benchmark PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 2
  • 3. About Me PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 3
  • 4. About Me • name: –小山健一郎 (id:k1LoW) •from Fukuoka • type: –PHPer, CakePHP baker, Emacser • membership: –Fusic Co.,Ltd • >> http://fusic.co.jp –codecheck.in • >> http://trac.codecheck.in and 101000code / 3rdSTONE PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 4
  • 5. PHPといえば*AMP PHP = *AMP? PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 5
  • 6. PostgreSQL ちなみに私はLAPPが好きです I like LAPP PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 6
  • 7. RDBMもいいけれど key/value型DBMも使ってみたい! I like RBMS. But,I want to use key/value DBM too. PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 7
  • 8. About Tokyo Tyrant PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 8
  • 9. Tokyo Tyrant (TT) • Tokyo Tyrant is network interface of Tokyo Cabinet (key/value DB library) – http://tokyocabinet.sourceforge.net/tyrantdoc/ PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 9
  • 10. Tokyo Tyrant (TT) • Tokyo Cabinet (TC)というkey/value型DBMの ネットワークインターフェース – Author:平林幹雄氏 – http://tokyocabinet.sourceforge.net/tyrantdoc/ • mixiの「最終ログイン」などを管理(しているらしい) – ↑ユーザがアクセスするたびに更新されるという高負荷 • TCP/IP上からバイナリプロトコルで接続可能 – memcachedのプロトコルにも対応 – HTTP互換 PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 10
  • 11. PHPからTokyo Tyrantを使いたい! I want to use Tokyo Tyrant with PHP! PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 11
  • 12. Tokyo Tyrant + PHP PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 12
  • 13. Tokyo Tyrant + PHP TT+PHPを実現するInterfaceや PHP Extensionは見つけているも のだけで4つ –TT独自バイナリプロトコルを扱うもの のみ –memcached互換のものは今回は除く PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 13
  • 14. Net_TokyoTyrant PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 14
  • 15. Net_TokyoTyrant • Author –個々一番氏(id:cocoiti) • feature –PurePHPライブラリ –Openpearにてリポジトリ管理 • http://openpear.org/package/Net_TokyoTyrant –PurePHPとして最適化されている –おそらく最も有名(だと思う) PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 15
  • 16. インストール Install PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 16
  • 17. $sudo pear install openpear/Net_TokyoTyrant-beta PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 17
  • 18. 簡単 Easy PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 18
  • 19. php-tokyo_tyrant • Author –Mikko Koppanen氏 (mkoppanen) • feature –PHP Extension –PECLに登録されている • PHP Manualもある –GitHubにてリポジトリ管理 • http://github.com/mkoppanen/php-tokyo_tyrant/tree/ master –最も活発に開発が進んでいる PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 19
  • 20. インストール Install PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 20
  • 21. $sudo pecl install tokyo_tyrant-beta PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 21
  • 22. 簡単 Easy PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 22
  • 23. dbo_tokyo • Author –Martin Samson氏 (masom) • feature –Datasource for CakePHP thechawにてリポジトリ管理 • http://thechaw.com/tokyotyrant_datasource ※#cakephp@irc.codecheck.in:6667で id:cakephperさんに教えてもらいました PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 23
  • 24. tokyotyrant_php • Author –俺 • feature –tokyotyrant.rbに、できるだけ近づけ た実装を目指している –Net_TokyoTyrantを参考に作成 • Fork? –GitHubにてリポジトリ管理 • http://github.com/k1LoW/tokyotyrant_php/tree/master –最もβ、むしろα PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 24
  • 25. Simple Benchmark PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 25
  • 26. ※参考程度に考えてください It's very simple ^^; PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 26
  • 27. PHPなのでhttp://で アクセスしてみた Simple HTTP Access Benchmark PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 27
  • 28. Simple Benchmark • 単純にApache Benchで計測して みた ランダムなkeyで クエリ発行 ab –n 1000 – c 100 •Apache 対象データ: sha1($i)をkey、$iをvalueとした •mod_php 1,000,000レコード •DBM PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 28
  • 29. 1アクセス1クエリ ※Request/sec相対 1 access 1 query PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 29
  • 30. 1アクセス1クエリ Net_TokyoTyrant dbo_tokyo MySQL plane html php-tokyo_tyrant tokyotyrant_php ※Request/sec相対 PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 30
  • 31. 1アクセス100クエリ ※Request/sec相対 1 access 100 query PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 31
  • 32. 1アクセス100クエリ ! Net_TokyoTyrant dbo_tokyo MySQL plane html php-tokyo_tyrant tokyotyrant_php ※Request/sec相対 PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 32
  • 33. まとめ • Tokyo Tyrant + PHPの紹介をしま した。 • php-tokyo_tyrantが最も高速 – php-tokyo_tyrant = very fast • PurePHPならNet_TokyoTyrant – Net_TokyoTyrant = Nice PurePHP library • CakePHPならdbo_tokyo – dbo_tokyo = CakePHP use • tokyotyrant_phpは…? PHP Conference Japan 2009 LT Copyright Fusic Co.,Ltd. 33