Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ProtocolBuffers調べてみた
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
yoshihiro.ri
November 28, 2024
15
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ProtocolBuffers調べてみた
勉強会で発表する時に使ったスライドです
※正確な情報をお求めの方は公式ドキュメントを参照ください
yoshihiro.ri
November 28, 2024
More Decks by yoshihiro.ri
See All by yoshihiro.ri
LINEで朝活!技術トレンドを1日1分でキャッチする『Daily Tech Digest』を作ってみた
yoshihiro999
0
610
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Thoughts on Productivity
jonyablonski
76
5.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
490
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
Un-Boring Meetings
codingconduct
0
460
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
560
Transcript
ProtocolBuffers 調べてみた
Protocol Buffersとは? スキーマ言語 データのバイナリ変換に使えるフォーマット 異なる言語同士の通信に役立つ Google が開発 gRPCに使われている
Protocol Buffersとは? Userデータ ① ②
Protocol Buffersとは? Userデータ ① ② uint32と思っていたのでエラーが起きました
Protocol Buffersとは? protoファイル
Protocol Buffersとは? バイナリデータ 1.クラス生成 2.データをシリアライズ protoファイル ① ②
Protocol Buffersとは? protoc user.proto --python_out Pythonのクラス定義が自動生成 1.クラス生成
data: b'\n\x05Alice\x10\x19\x1a\
[email protected]
' 2.データをシリアライズ
Protocol Buffersとは? ① ② uint64ね、はいはい 1.クラス生成 2.データをデシリアライズ バイナリデータ protoファイル
本文を追加 javascriptはint64を正確に扱えない 1234567890123457000に丸めてしまう 1.言語非依存
言語非依存 どの言語でもprotoファイルからコード生成できる シリアライズで言語特有の値の受け渡し精度を改善
前方・後方互換性
前方・後方互換性 異なるprotoファイルのバージョンの共存ができる ver. 1.0 ver. 1.1
前方・後方互換性 バイナリデータ 1.0 protoファイル ① ② ver. 1.0 ver. 1.1
desert,foodには デフォルト値が入る
前方・後方互換性 バイナリデータ 1.1 protoファイル ① ② ver. 1.0 ver. 1.1
desert,foodは 無視します
ver. 1.0 ver. 1.1 ver. 1.2 ver. 1.4 異なる言語、異なるproto間の やり取りが可能!!!
ver. 1.1
デメリット 可読性が低い 1. スキーマ依存 2. デバッグしづらい 3. RESTful APIとの相性が悪い 4.
メッセージサイズが小さいとメリットが薄い 5.
概要: Googleが開発したバイナリデータシリアライズフォーマット メリット: 高速、非言語依存、後方・前方互換性あり デメリット: 可読性低い、スキーマ依存、RESTful APIあまり向いてない Protocol Buffers(Protobuf)まとめ
質問タイム
ありがとうございました!