Upgrade to Pro — share decks privately, control downloads, hide ads and more …

tokyo.ex #1 - phoenixframeworkの足回り

tokyo.ex #1 - phoenixframeworkの足回り

phonenixのEndpointを起点としたリクエスト処理の流れの説明とよくある実装を使ったcase study

Hidetaka Kojo

April 19, 2016
Tweet

More Decks by Hidetaka Kojo

Other Decks in Technology

Transcript

  1. .Z"QQ "QQMJDBUJPO w MJCNZ@BQQFYͰఆٛ w BQQMJDBUJPOىಈͷى఺ w ࠷ॳʹىಈ͍ͯ͠Δͷ͸
 ӈͷͭ w

    ͜ͷͭΛཧղͨ͠Β
 QIPFOJYͷಈ࡞Λཧղͨ͠΋ಉ͡ʂ ͷ͸ͣ .Z"QQ .Z"QQ4VQFSWJTPS .Z"QQ&OEQPJOU .Z"QQ3FQP
  2. 1MVH  w ͦ΋ͦ΋1MVHͬͯʁ w 1MVH$POOߏ଄ମΛೖྗͯ͠
 1MVH$POOߏ଄ମΛग़ྗ͢Δ΋ͷ w ͦΕ͸Կ͔ҙຯ͕͋Δͷʁ w

    ͜ͷ࢓૊ΈͰQIPFOJY͸ߏ੒͞Ε͍ͯΔͱ
 ݴͬͯ΋աݴͰ͸ͳ͍ QMVH" 1MVH$POO 1MVH$POO`
  3. .Z"QQ&OEQPJOU  w 1MVH"EBQUFST$PXCPZ)BOEMFS w &OEQPJOUͰઃఆͨ͠QMVHͷDBMM͕ͳ͞ΕΔ w IUUQTHJUIVCDPNFMJYJSMBOHQMVHCMPCNBTUFSMJCQMVH BEBQUFSTDPXCPZIBOEMFSFY- w

    &OEQPJOUʹࢦఆ͞ΕͨQMVHΛ্͔Βॱʹ
 దԠ͍ͯ͘͠ w ্͔Βॱͳͷ͸1MVH#VJMEFSͰͦͷॱ൪ͰݻΊ ΒΕ͍ͯΔͨΊ
  4. ͜͜·Ͱͷ·ͱΊ w .Z"QQ "QQMJDBUJPO Λத৺ʹQIPFOJYΛݟͯΈͨ w UFNQMBUFͱ͔WJFX͸ʜ w TPDLFU͸Ҏલʹগ͠࿩ͨ͠ͷͰͦͪΒΛʜ w

    IUUQXXXTMJEFTIBSFOFUIJEFUBLBLPKPFMJYJS w ͔͜͜Β͸্هͷ಺༰Λ౿·͑ͯΑ͋͘Γͦ͏ͳ
 ػೳΛ࣮૷͢Δ
  5. ͋Δ͋Δ࣮૷ NTHQBDL"1*Λ࢖͍͍ͨ  w ཁ݅ w NTHQBDL"1* QSPUPCVG"1*ͷ࣮૷ w ԿΛ͢Ε͹͍͍ͷ͔

    w CPEZͷத਎ΛEFDPEF͢Δॲཧ w TFOE@SFTQͰૹ৴࣌ʹFODPEF͢Δॲཧ
  6. ͋Δ͋Δ࣮૷ NTHQBDL"1*Λ࢖͍͍ͨ  w $POUSPMMFSͷதͰ͸EFDPEF͞ΕQBSBNTʹೖ͍ͬͯΔ w .Z"QQ3PVUFSΑΓલͷQMVHͰॲཧ͞Ε͍ͯΔ w 1MVH1BSTFS w

    QBSTFSTʹ!CFIBWJPVS1MVH1BSTFSTͳNPEVMFΛ
 ॻ͘͜ͱͰಠࣗͷQBSTFॲཧ͕͔͚Δ w QBSTFͱEFDPEF w 1MVH1BSTFST+40/Λ·Ͷͯมߋ͢Ε͹؆୯ʹʂ