Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby gRPCを使って「ちゃんと」サービスを作る / Make a service pro...
Search
Shintani Teppei
December 18, 2019
Technology
1
890
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
モジュラモノリス、その前に / Modular monolith, before that
euglena1215
8
860
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
160
rbs-inlineを導入してYARDからRBSに移行する
euglena1215
1
510
Ruby の型に関する活動をやっている話 / Activities related to Ruby types
euglena1215
3
270
そろそろ理解する includes / Understanding includes
euglena1215
1
850
習うより慣れる Ruby AST / Ruby AST is better to get used to than to learn.
euglena1215
2
440
Railsでエンドポイントごとのテストカバレッジを測定する / Measuring Test Coverage per Endpoint in Rails
euglena1215
1
430
初めてrails/railsにバグレポートを出してみた
euglena1215
0
210
XXXSerializer#to_json を地道に置き換えている話
euglena1215
0
150
Other Decks in Technology
See All in Technology
開発者向けツールを魔改造してセキュリティ診断ツールを作っている話 - 第1回 セキュリティ若手の会 LT
pizzacat83
0
400
AWS re:Invent 2024 re:Cap CloudFront編
yoshimi0227
0
120
re:Invent2024のIaC周りのアップデート&セッションの共有/around-re-invent-2024-iac-updates
tomoki10
0
710
MySQL 8.0 から PostgreSQL 16 への移行と RLS 導入までの道のりと学び
baseballyama
0
1.1k
WernerVogelsのKeynoteで語られた6つの教訓とOps
hatahata021
0
140
My Generation 年配者がこの先生きのこるには (Developers CAREER Boost 2024 Edition)/My Generation How elder engineers can survive
kwappa
3
380
コーポレートデータマスター構築への道
kworkdev
PRO
0
130
テーブルが200以上あるSaaSでRSCとGraphQLを併用する理由
msickpaler
1
160
高品質と高スピードを両立させるソフトウェアQA/Software QA that Supports Agility and Quality
goyoki
10
1.7k
12/4(水)のBedrockアプデ速報(re:Invent 2024 Daily re:Cap #3 with AWS Heroes)
minorun365
PRO
2
420
Advancing the 3D Geospatial Ecosystem in Japan via Global Collaborations
osgeojp
0
190
突き破って学ぶコンテナセキュリティ/container-breakout-cncj-lt
mochizuki875
7
1.1k
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Faster Mobile Websites
deanohume
305
30k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Building Adaptive Systems
keathley
38
2.3k
A Tale of Four Properties
chriscoyier
157
23k
For a Future-Friendly Web
brad_frost
175
9.4k
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 ͕ී௨ʹ͑Δ ঢ়ଶʹͳΔ·Ͱ͍͖ͬͯ