SwiftでgRPCとProtocolBuffersを使う

5287c9b9576749092d3170ec738338b8?s=47 Yusuke Ito
January 27, 2017

 SwiftでgRPCとProtocolBuffersを使う

5287c9b9576749092d3170ec738338b8?s=128

Yusuke Ito

January 27, 2017
Tweet

Transcript

  1. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE 4XJGUͰH31$ͱ 1SPUPDPM#V⒎FSTΛ࢖͏ ϦʔυΞʔΩςΫτ
 ҏ౻༞ี :VTVLF*UP !OPWJ@ നϠΪίʔϙϨʔγϣϯ 5PLZP4FSWFS4JEF4XJGU.FFUVQ
 

  2. ݄೔ʙ೔

  3. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE 

  4. ΄͔े਺ࣾ ΧϝϦΦͷΞϧΰϦζϜΛαʔϏεͱͯ͠"1*ఏڙ

  5. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE 1SPUPDPM#V⒎FST 1SPUPCVG w ೥ʹ஀ੜɺ೥ॳެ։ɺݱ࣌఺Ͱόʔδϣϯ w ௨৴ɾӬଓԽͷͨΊͷγϦΞϥΠζϑΥʔϚοτ w ༻్ͱͯ͠͸+40/΍9.- 1SPQFSUZ-JTUؚΉ

    ʹ͍ۙ w ΫϩεϓϥοτϑΥʔϜ w ߴ଎Ͱɺ௨ৗόΠφϦσʔλ w ޙํޓ׵ੑ͋Γ ݹ͍ఆٛ΋৽͍͠ఆٛͰಡΈࠐΊΔ 
  6. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE  QSPUPϑΝΠϧ ϑΟʔϧυɺܕΛهड़ TXJGUͷίʔυ TUSVDU QSPUPD ίϯύΠϥ HPͷίʔυ TUSVDU

    DQQͷίʔυ DMBTT
  7. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE γϦΞϥΠζɾ
 σγϦΞϥΠζ  IUUQTHJUIVCDPNBQQMFTXJGUQSPUPCVG %BUB /4%BUB 4XJGU TUSVDU %BUB

    /4%BUB 4XJGU TUSVDU อଘ ௨৴
  8. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE H31$ w 31$ 3FNPUFQSPDFEVSFDBMM ௨৴ن֨ w ௨৴͸)551Λ࢖༻ w 31$ͷఆٛʹ1SPUPDPM#V⒎FSTΛ࢖༻

    w /4%BUB όΠφϦ Λ΍ΓͱΓ͢Δ w γϦΞϥΠζʹ͸ඪ४తʹ1SPUPDPM#V⒎FSTΛ࢖༻ w ΫϩεϓϥοτϑΥʔϜ 
  9. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE 31$ͷఆٛ  QSPUP্Ͱߦͳ͏

  10. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE  QSPUPϑΝΠϧ αʔϏεΛهड़ TXJGUͷίʔυ αʔόʔɾΫϥΠΞϯτͷίʔ υҰࣜ ελϒ QSPUPD ίϯύΠϥ

    HPͷίʔυ αʔόʔɾΫϥΠΞ ϯτͷίʔυҰࣜ DQQͷίʔυ αʔόʔɾΫϥΠΞ ϯτͷίʔυҰࣜ
  11. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE 4XJGU࣮૷ ݱ࣌఺  ࣮૷
 ϦϙδτϦ ϓϥοτ ϑΥʔϜ αʔόʔ ΫϥΠΞϯτ

     HSQDHSQD "QQMFͷΈ ͳ͠ 0CKFDUJWF$ Ͱͷ࣮૷ 
 HSQDHSQD TXJGU -JOVY"QQMF
 Φʔϓϯιʔ ε൛ $ͱ4XJGUͰͷ ࣮૷ $ͱ4XJGUͰͷ ࣮૷ IUUQTHJUIVCDPNHSQDHSQDHJU IUUQTHJUIVCDPNHSQDHSQDTXJGUHJU
  12. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE &YBNQMFΛࢼ͢ w IUUQTHJUIVCDPNHSQDHSQDTXJGUHJU w όʔδϣϯ͸ w HSQDͷ$ϥΠϒϥϦΛΠϯετʔϧ͓ͯ͘͠ 3&"%.&ࢀরɺNBLFJOTUBMM͢Δ 

  13. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE Կʹ࢖͏͔ w )551T +40/ͷ௨৴ͷஔ͖׵͑ w J04ΞϓϦͷ"1*ͱͯ͠ w αʔόʔͱΫϥΠΞϯτͰಉ͡.PEFM QSPUPఆٛ

    ͕࢖͑Δϝ Ϧοτ w ϑΝΠϧ΍σʔλϕʔεอଘ࣌ͷγϦΞϥΠζ w ܕνΣοΫೖΓͷγϦΞϥΠζ QMJTUͱൺ΂ͯ ͕Ͱ͖Δ w ϚΠΫϩαʔϏεͳͲͷ಺෦௨৴ +40/31$ͳͲͷஔ͖׵͑ 
  14. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE ΞϓϦͷ"1*ͱͯ͠ w αʔόʔαΠυଆΛ4XJGU΍(P +BWBͳͲͰॻ͘ w ΫϥΠΞϯταΠυଆΛ4XJGUͰॻ͘ w .PEFM QSPUPఆٛ

    ͸ڞ௨ w )551ϝιουͱ63*ͷ୅ΘΓʹɺ31$ͷ໊લۭؒɾαʔϏ ε໊ɾϝιου໊Λ࢖͏ w 31$͸QSPUPʹهड़͞ΕΔͷͰυΩϡϝϯτʹ΋ͳΔ w αʔόʔͱΫϥΠΞϯτ͸ࣗಈੜ੒͞ΕΔ 
  15. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE ӬଓԽ࣌ͷγϦΞϥΠζ w J04Ͱ͋Ε͹ɺ+40/ 6TFS%FGBVMUT 1SPQFSUZ -JTUΛஔ͖׵͑ w ܕͷαϙʔτ w

    4XJGUͷTUSVDUͷσʔλΛͦͷ··σʔλϕʔεʹ ೖΕ͍ͨ৔߹ ׶͑ͯΧϥϜʹ͠ͳ͍৔߹  w .Z42-Ͱ͋Ε͹ɺ1SPUPCVGΛ#-0#ʹͯ͠อଘ 
  16. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE ؾʹͳΔͱ͜Ζ w 4XJGUαΠυ w 0QUJPOBMͱ͍͏දݱ͕ͳ͍ ˞࠷৽ͷ1SPUPCVGγ ϯλοΫεͷ৔߹  w

    POFPGͰ͍͓ͪ͏දݱՄೳ w σϑΥϧτ஋͕ͳ͍ ˞  w ஋ೖΓFOVN͸දݱͰ͖ͳ͍