Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
gRPC入門
Search
To Kawa
December 01, 2019
Technology
0
98
gRPC入門
To Kawa
December 01, 2019
Tweet
Share
More Decks by To Kawa
See All by To Kawa
GoとKubernetesを用いたバッチ開発のすすめ
waytkheming
2
2.1k
Other Decks in Technology
See All in Technology
生成AIの強みと弱みを理解して、生成AIがもたらすパワーをプロダクトの価値へ繋げるために実践したこと / advance-ai-generating
cyberagentdevelopers
PRO
1
160
失敗しないOpenJDKの非互換調査
tabatad
0
260
Vueで Webコンポーネントを作って Reactで使う / 20241030-cloudsign-vuefes_after_night
bengo4com
4
2.4k
フルカイテン株式会社 採用資料
fullkaiten
0
36k
Aurora_BlueGreenDeploymentsやってみた
tsukasa_ishimaru
1
120
AIを使って小説を書こう!【2024/10/25講演資料】
kamomeashizawa
0
180
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.6k
マネジメント視点でのre:Invent参加 ~もしCEOがre:Inventに行ったら~
kojiasai
0
350
話題のGraphRAG、その可能性と課題を理解する
hide212131
4
1.3k
Emacs x Nostr
hakkadaikon
1
140
都市伝説バスターズ「WebアプリのボトルネックはDBだから言語の性能は関係ない」 - Kaigi on Rails 2024
osyoyu
21
11k
Automated Promptingを目指すその前に / Before we can aim for Automated Prompting
rkaga
0
100
Featured
See All Featured
Optimizing for Happiness
mojombo
376
69k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Code Reviewing Like a Champion
maltzj
519
39k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Writing Fast Ruby
sferik
626
60k
Designing for Performance
lara
604
68k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
106
49k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Transcript
GoݴޠͰgRPCʹೖͯ͠Έͨ
ࣗݾհ Տ༢ढ़ً גࣜձࣾLIFULL CoEϢχοτ։ൃਪਐάϧʔϓॴଐ ৽ଔ1 ڵຯͷ͋Δ ɾϒϩοΫνΣʔϯ ɾFintech ݴޠ
Node/Solidity/PHP/Apex/Go
gRPCͱԿ͔ • Google͕։ൃͨ͠RPCݺग़ϓϩτίϧ • ϝοηʔδProtocolBuffersΛ༻͍ͯ௨৴ • HTTP/2Λ༻͍ͯฒྻݺग़ɺํݺग़ɺετϦʔϛϯά ͳͲ͕Մೳ • .protoϑΝΠϧ͔Βίʔυ͕ࣗಈੜͰ͖Δ
• GoogleͷαʔϏεͰ࣮ࡍʹΘΕ͍Δ
gRPCͱԿ͔ ΫϥΠΞϯτͱαʔόͰෳͷݴޠΛαϙʔτ͍ͯ͠Δ →ϚΠΫϩαʔϏεͳͲͱ૬ੑ͕͍͍
4ͭͷRPCํࣜ • Unary(Simple) →1 request-1 response • ServerStreaming →1 request-N
response • ClientStreaming →N request-1 response • BidirectionalStreaming →N request-N response
ϝϦοτ • REST APIΑΓURLઃܭָ͕ →protoϑΝΠϧͰAPI༷Λ໌จԽͰ͖Δ →දଆͱཪଆ͕༷ͷ͢Γ߹Θָ͕ͤ • HTTP/2Ͱฒྻݺग़ͳͲ͕Ͱ͖ΔͨΊɺߴ • ύϥϝʔλʔͷܕ͚͕Ͱ͖Δ
࡞ͷྲྀΕ 1. protoϑΝΠϧͷ࡞ 2. ᶃͰ࡞ͨ͠ϑΝΠϧΛίϯύΠϧͯ͠ɺࣗಈͰܗ ίʔυΛੜ 3. ܗίʔυΛݩʹαʔόʔˍΫϥΠΞϯτΛ࣮͢Δ
࣮ࡍʹͬͯΈΔ (Ұ൪γϯϓϧͳUnary)
protoϑΝΠϧ࡞
ίϚϯυ࣮ߦ
ίϚϯυͰੜ͞ΕΔܗϑΝΠϧ https://github.com/waytkheming/calculator-proto/blob/master/proto/calculator.pb.go
Serverଆ
Clientଆ
࣮ߦ
MongoDBΛͬͯCUIͷTwitterΈ͍ͨͳͷΛ࡞ͬͯΈͨ https://github.com/waytkheming/gwitter-proto
ࢀߟURL • gRPC Documentation https://grpc.io/docs/ • ΫοΫύου͕gRPCΛ࠾༻͢Δ·ͰαʔϏεؒ௨৴Ͱ๊͑ͯ ͍ͨ՝ͱɺRubyͰgRPCΛӡ༻͢ΔͨΊͷ https://logmi.jp/tech/articles/320715 •
gRPCͬͯԿʁ https://qiita.com/oohira/items/63b5ccb2bf1a913659d6 • gRPCʹ͓͚ΔRPCํࣜͷཧ https://qiita.com/yuzo777/items/046910c95559cf0fff68
Gopherಓͷײ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·͠ ͨɻ