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
100
gRPC入門
To Kawa
December 01, 2019
Tweet
Share
More Decks by To Kawa
See All by To Kawa
GoとKubernetesを用いたバッチ開発のすすめ
waytkheming
2
2.2k
Other Decks in Technology
See All in Technology
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
200
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
13k
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
Engineer Career Talk
lycorp_recruit_jp
0
190
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
320
生成AIが変えるデータ分析の全体像
ishikawa_satoru
0
170
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
130
AI前提のサービス運用ってなんだろう?
ryuichi1208
8
1.4k
SSMRunbook作成の勘所_20241120
koichiotomo
3
160
複雑なState管理からの脱却
sansantech
PRO
1
150
Featured
See All Featured
Music & Morning Musume
bryan
46
6.2k
Embracing the Ebb and Flow
colly
84
4.5k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
How to Ace a Technical Interview
jacobian
276
23k
10 Git Anti Patterns You Should be Aware of
lemiorhan
655
59k
Fireside Chat
paigeccino
34
3k
Designing for Performance
lara
604
68k
Writing Fast Ruby
sferik
627
61k
Scaling GitHub
holman
458
140k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
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ಓͷײ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·͠ ͨɻ