Riak & riak-php-client

E1923013dacab39eb231a2fffbf7b33c?s=47 UENISHI Kota
February 28, 2013

Riak & riak-php-client

much ado about Riak and PHP

E1923013dacab39eb231a2fffbf7b33c?s=128

UENISHI Kota

February 28, 2013
Tweet

Transcript

  1. Riak && riak-php-client 2013/2/28 PHPษڧձ#65

  2. •্੢߁ଠ @kuenishi •PHPॳ৺ऀͰ͢ •෼ࢄγεςϜͷݚڀ΍։ൃΛ5೥͘Β͍ •೔ຊ๏ਓ͕ࡢ೥9݄ʹͰ͖ͨ ͓લɺ୭Α

  3. ۓٸΞϯέʔτ • RiakΛฉ͍ͨ͜ͱ͕͋Δ [Y/y]? • Riak CSΛฉ͍ͨ͜ͱ͕͋Δ [Y/n]? • MySQL

    ClusterΛ࢖ͬͨ͜ͱ͕͋Δ [Y/n]? • HBase΍CassandraͰۤ͠Μͩ͜ͱ͕͋Δ [Y/n]?
  4. None
  5. • DynamoʹΠϯεύΠϠ͞Εͨ • Consistent HashingʹΑΓਫฏ෼ࢄ͢Δ • Vector ClocksΛ༻͍ͯϨϓϦέʔγϣϯ͠ • Erlang/OTPͰಈ࡞͢Δ

    • ෼ࢄKVSͰ͋Δ WikiPedia: Vector Clocks
  6. Riakͷ͍͍ͱ͜Ζ • ߴՄ༻ੑ • εέʔϧΞ΢τ͢Δ • ӡ༻ָ͕ʢͱ͍ΘΕ͍ͯΔʣ • Ϛελʔ͕͍ͳ͍ •

    ʢNoSQLͷׂʹʣ࣮੷͕͋Δ • ୔ࢁͷΫϥΠΞϯτ(Ruby, Java, Python, PHP, Perl, OCaml, Haskell, .NET, ...) • ErlangͰಈ͘
  7. Riakͷ࢒೦ͳͱ͜Ζ • ଎͘͸ͳ͍ • τϥϯβΫγϣϯͰ͖ͳ͍ • 10000୆ͩͱଟ෼ಈ͔ͳ͍ • ΞϓϦઃܭ͕*SQL΄Ͳ؆୯Ͱͳ͍ •

    ErlangͰॻ͔Ε͍ͯΔ
  8. DEMO (ͨ͠ؾ෼) • HTTPͰGET, PUT, DELETEͯ͠ΈΔ • ը૾Λͦͷ··ஔ͚Δ

  9. DEMOͨ͠ମͰ • SQL୅ΘΓͷMapReduce • JavaScriptͰͦΕͳΓʹ͍Ζ͍ΖͰ ͖Δ • https://gist.github.com/4202161

  10. DEMOͨ͜͠ͱʹ͢Δ • Non-stop upgrade • ίʔυΛॻ͖׵͑ͯࢭΊͣʹߋ৽ • ௨ৗ࣌͸ඇਪ঑͕ͩۓٸ࣌ʹॏๅ • ྫ:

    Scaling Riak in Production
  11. riak_control (1.2~)

  12. ࢖͍Ͳ͜Ζ • 1୆ͷ෺ཧϚγϯʹ ऩ·Βͳ͍έʔε • εϞʔϧελʔτ͠ ͍ͨͱ͖ • Մ༻ੑ͕τοϓཁ݅ ͷ࣌

    • σʔλϞσϧΛKey, ValueʹͰ͖Δͱ͖ • Ad Networks • Digital Media • On-Line Games • Social Networks • Social Analysis • Cloud Operators • Messaging Services • Product Catalogs • Document Management • Health Care Information Management
  13. ຊ୊: riak-php-client • curlͷ࢖͍ํ͕ϔϯ • PEAR͔Β΋composer͔Β΋ೖΕΒΕͳ͍ • PBΫϥΠΞϯτ΄͍͠ʁ • υΩϡϝϯτ͍Δʁ

    • https://github.com/basho/riak-php-client
  14. composer͔Βߦ͚ΔΑ͏ʹ͠·ͨ͠ • composer.json <?php require 'vendor/basho/riak/riak.php'; $c = new RiakClient('127.0.0.1',

    8098) ?> { "require": { "basho/riak": "dev-master" } }
  15. ʲ※ະঝ୚ʳRiak͕ಈ͍͍ͯΔαʔϏε • http://cloud.yahoo.co.jp/new_storage/

  16. Q&A •@BashoJapan •#riakjp •riak-users-jp@lists.basho.com