SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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拡張勉強会
 

Kürzlich hochgeladen

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
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 WorkerThousandEyes
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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 FresherRemote DBA Services
 
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 educationjfdjdjcjdnsjd
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

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