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
Ruby gRPCを使って「ちゃんと」サービスを作る / Make a service properly using Ruby gRPC
Search
Shintani Teppei
December 18, 2019
Technology
1
770
Ruby gRPCを使って「ちゃんと」サービスを作る / Make a service properly using Ruby gRPC
Shintani Teppei
December 18, 2019
Tweet
Share
More Decks by Shintani Teppei
See All by Shintani Teppei
習うより慣れる Ruby AST / Ruby AST is better to get used to than to learn.
euglena1215
2
200
Railsでエンドポイントごとのテストカバレッジを測定する / Measuring Test Coverage per Endpoint in Rails
euglena1215
1
200
初めてrails/railsにバグレポートを出してみた
euglena1215
0
120
XXXSerializer#to_json を地道に置き換えている話
euglena1215
0
120
GitHub Copilot を使って自作ライブラリを作ってみよう/ Let's create your own library using GitHub Copilot!
euglena1215
0
210
エンジニア目線で考える、プロダクト開発を適用したブース設計 / Booth design applying product development
euglena1215
0
610
どんなときにテストを書いた方がいいのか/When should you write a test?
euglena1215
1
430
10万円支給されるやつ/10manen-hoshii
euglena1215
1
180
新卒がマイクロサービス化を行うメリット / Benefits of did microservices by new grads #megurorb
euglena1215
0
1.3k
Other Decks in Technology
See All in Technology
Azure犬駆動開発の記録/GlobalAzureFukuoka2024_20240420
nina01
1
210
どうするコスト最適化のトレードオフ
tetsuyaooooo
1
520
複雑な構成要素を持つUIとの向き合い方 〜新・支出グラフでの実例〜 / B43 TECH TALK
nakamuuu
0
140
推しは推せるときに推せ! プロダクトにフィードバックしていこう
nakasho
0
310
自己改善からチームを動かす! 「セルフエンジニアリングマネージャー」のすゝめ
shoota
6
630
MLOpsの「壁」を乗り越える、LINEヤフーの Data Quality as Code
lycorptech_jp
PRO
5
510
「スニダン」開発組織の構造に込めた意図 ~組織作りはパッションや政治ではない!~
rinchsan
3
570
SIEMを用いて、セキュリティログ分析の可視化と分析を実現し、PDCAサイクルを回してみた
coconala_engineer
0
300
MySQL の SQL クエリチューニングの要所を掴む勉強会
andpad
2
6.3k
Janus
bkuhlmann
1
490
生産性向上チームの紹介
cybozuinsideout
PRO
1
870
【NW X Security JAWS#3】L3-4:AWS環境のIPv6移行に向けて知っておきたいこと
shotashiratori
0
140
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
124
8.5k
jQuery: Nuts, Bolts and Bling
dougneiner
59
7.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
125
32k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Code Review Best Practice
trishagee
55
15k
Art, The Web, and Tiny UX
lynnandtonic
289
19k
The Brand Is Dead. Long Live the Brand.
mthomps
49
28k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
2
3.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
121
39k
Ruby is Unlike a Banana
tanoku
96
10k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Designing Experiences People Love
moore
136
23k
Transcript
©2019 Wantedly, Inc. Ruby gRPC Λͬͯ ʮͪΌΜͱʯαʔϏεΛ࡞Δ Scramble Tech ৽ଔLT
Dec 18, 2019 - Teppei Shintani
©2019 Wantedly, Inc. About me Teppei Shintani @euglena1215 • ’19
Wantedly new grads • Server side engineer • Wantedly Visit ืूػೳͷϚΠΫϩαʔϏεԽ • Ruby ❤ • ϚΠΫϩαʔϏεԽ͍͖ͬͯ
©2019 Wantedly, Inc. gRPCͱʁ ͱʁ
©2019 Wantedly, Inc. Google ͕࡞ͬͨ ݴޠඇґଘͷ௨৴ϓϩτίϧ gRPCͱʁ
©2019 Wantedly, Inc.
©2019 Wantedly, Inc. gRPC library Google ͕ ϝΠϯͰ։ൃΛߦ͍ͬͯΔ
©2019 Wantedly, Inc. ֤ݴޠͷख़ GoogleͷϞνϕʔγϣϯ࣍ୈ
©2019 Wantedly, Inc. Ruby gRPC ͷख़্͕͕Βͳ͍ Ruby gRPC ͷपลϥΠϒϥϦ͕ू·Βͳ͍
©2019 Wantedly, Inc. ݫ͍͠ڥͷ Ruby gRPC Λͬͯ αʔϏεΛ࡞͍ͬͯͨ͘Ίʹ
©2019 Wantedly, Inc. •൚༻తͳ grpc interceptor •։ൃੜ࢈ੑ্͛ΔϥΠϒϥϦ •Ruby gRPC best
practice ͷࡧ ͍ͬͯΔ͜ͱ
©2019 Wantedly, Inc. grpc interceptorͱʁ ൚༻తͳgrpc interceptor grpc interceptor ͱ௨৴(rpcݺͼ
ग़͠)ͷલޙͰಛఆͷॲཧΛΈࠐΊ Δػߏɻ express, rack middleware ͱ͍ͩ ͍ͨಉ͡ͱ͍͑ΘΔਓΘΔ ͔
©2019 Wantedly, Inc. ࡞ͬͨ grpc interceptor ൚༻తͳgrpc interceptor • ΤϥʔΛࢹαʔϏεʹૹͬͯ͘ΕΔ͘Μ
• Ruby/Rails ґଘͷΤϥʔΛ gRPC Τϥʔʹม͢Δ͘Μ • activerecord ͷ connection Λྑ͍ײ͡ʹ͍ճ͘͢Μ •ΞΫηεϩάΛͱͬͯҙͷproviderૹ৴͢Δ͘Μ by @south37 • newrelic ʹ metrics Λૹ৴ͯ͘͠ΕΔ͘Μ by @south37
©2019 Wantedly, Inc. Protocol Buffersͷੑ࣭ ։ൃੜ࢈ੑ্͛ΔϥΠϒϥϦ • field શͯ optional
• proto2 Ͱ required field ͕ଘࡏ͕ͨ͠ɺproto3Ͱશͯ optional ʹͳͬͨ • required ͳ field Λഇࢭͨ͘͠ͳͬͨͱ͖ʹޙํޓΛҡ࣋͢Δͷ͕͍͠ ΞϓϦέʔγϣϯଆͷϩδοΫͰ null ͔Ͳ͏͔ΛνΣοΫ͢Δඞཁ͕͋Δ ΊͪΌͪ͘Ό໘
©2019 Wantedly, Inc. grpc_required_annotator ։ൃੜ࢈ੑ্͛ΔϥΠϒϥϦ https://github.com/euglena1215/grpc_required_annotator
©2019 Wantedly, Inc. Ruby gRPC best practice ͷࡧ • Rails
ͷݟΛ Ruby gRPC ʹͲ͏ྲྀ༻͢Δ͔ • Rails controller ʹґଘ͍ͯ͠Δ gem Ұ௨Γ͑ͳ͍ • ͲΜͳઃܭʹ͢Δͱ͍͍ͷ͔ʁ • Rails Έ͍ͨʹ DB table ͱ API interface Λີ݁߹ͤͨ͘͞ͳ͍ • MVVM? Ͳ͜·ͰΔʁ
©2019 Wantedly, Inc. Ruby gRPC best practice ͷࡧ • Rails
ͷݟΛ Ruby gRPC ʹͲ͏ྲྀ༻͢Δ͔ • Rails controller ʹґଘ͍ͯ͠Δ gem Ұ௨Γ͑ͳ͍ • ͲΜͳઃܭʹ͢Δͱ͍͍ͷ͔ʁ • Rails Έ͍ͨʹ DB table ͱ API interface Λີ݁߹ͤͨ͘͞ͳ͍ • MVVM? Ͳ͜·ͰΔʁ ͜͜ͷ݁·ͩग़͍ͯͳ͍ɺɺɺ
©2019 Wantedly, Inc. Ruby gRPC ͕ී௨ʹ͑Δ ঢ়ଶʹͳΔ·Ͱ͍͖ͬͯ