SlideShare a Scribd company logo
What I learned about APIs in my first year at Google
(Protocol Buffers and gRPC)
timburks@google.com
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
10 billion+
API callsevery second
I was an “indie” iOS developer
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
What I knew about APIs before I joined Google:
APIs are essential.
APIs must be tested to be sure they work.
APIs must be designed appropriately for their
applications.
Google Cloud Platform
The Fallacies of Distributed Computing
The network is reliable
Latency is zero
Bandwidth is infinite
The network is secure
https://blogs.oracle.com/jag/resource/Fallacies.html
Topology doesn't change
There is one administrator
Transport cost is zero
The network is homogeneous
There’s this wall.
Conway’s Law: “organizations which design systems... are constrained to produce
designs which are copies of the communication structures of these organizations.”
Cloud platforms can help
us tear down that wall.
10 billion+
API callsevery second
When you do a lot of something, you want to pay
attention to it.
You develop a language for describing it.
You optimize it.
You standardize it.
You make it flexible, so it can adapt to changes.
Protocol buffers are a language-neutral, platform-neutral, extensible mechanism
for serializing structured data.
Implemented in many languages, sometimes many times...
“Protocol Buffers” means several things
1. A serialization mechanism
2. An interface description language
3. A methodology
Protocol Buffer Serialization
It’s just a stream of bytes
[field_number<<3 + wire_type] [length if necessary] [data]...
$ hexdump /tmp/request.pb
0000000 0a 05 68 65 6c 6c 6f
0a is “0000 1010”, so
field_number = 1
wire_type = 2
echo.proto
syntax = "proto3";
package echo;
service Echo {
rpc Get(EchoRequest) returns (EchoResponse) {}
rpc Update(stream EchoRequest) returns (stream EchoResponse) {}
}
message EchoRequest {
string text = 1;
}
message EchoResponse {
string text = 1;
}
The Protocol Buffer Language
The Protocol Buffer methodology
$ protoc echo.proto --go_out=.
$ more echo.pb.go
// Code generated by protoc-gen-go.
// source: echo.proto
// DO NOT EDIT!
...
A remote procedure call (RPC) framework layered on HTTP/2
Enables client and server applications to communicate transparently
Client “calls” methods on a Server (which may be on a different machine) as if it
were a local service
Makes it easy to build heterogeneous distributed systems
Separate full implementations in C, Java, and Go.
Google Cloud Platform
Interoperability
Java
Service
Python
Service
GoLang
Service
C++
Service
gRPC
Service
gRPC
Stub
gRPC
Stub
gRPC
Stub
gRPC
Stub
gRPC
Service
gRPC
Service
gRPC
Service
gRPC
Stub
Unary (nonstreaming) API
syntax = “proto3”;
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}
service HelloService {
rpc SayHello(HelloRequest) returns (HelloReply);
}
Unary API: Client sends a
request, server sends a
response
Streaming APIs - 1 (of 3) Client Streaming
syntax = “proto3”;
message Latency {
string name = 1;
double val = 2;
}
message Histogram {
string name = 1
double p99 = 2;
double p999 = 3;
double avg = 4;
}
service MetricsService {
rpc ReportLateny(stream Latency) returns Histogram;
}
Client Streaming API: Client
sends multiple messages;
Server sends one response
(Note: Server may choose to send the response
before all the client messages are received)
Streaming APIs - 2 (of 3) Server Streaming
syntax = “proto3”;
message StockRequest {
string stocksymbol = 1;
}
message StockResponse {
double price = 1;
}
service StockTickerService {
rpc GetTicker(StockRequest) returns (stream StockResponse);
}
Server Streaming API: Client
sends one message; Server
sends multiple messages
Streaming APIs - 3 (of 3) Bidirectional Streaming
syntax = “proto3”;
message ChatMessage {
string msg = 1;
}
service ChatService {
rpc Chat(stream ChatMessage) returns (stream ChatMessage);
}
Bidi Streaming API: Client and
Server can send multiple
messages to each other
(Note: Client and server can independently send
messages to each other i.e they do not have to wait
for receiving a client message before sending a
message)
Google Cloud Platform
Some gRPC Adopters
Google Cloud Platform
Netflix deprecated its RPC framework in favor of
gRPC:
“Our team has instead building an RPC solution on top
of gRPC. We are doing this transition for two main
reasons: multi-language support and better
extensibility/composability through request
interceptors. That’s our current plan moving forward.”
https://github.com/Netflix/ribbon
gRPC Adopters
We’re building Swift support for gRPC.
We are working to bring Protocol Buffers
and gRPC support into OpenAPI.
timburks@google.com
Ad

More Related Content

What's hot (20)

Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In Java
Ankur Agrawal
 
OSMC 2019 | Grafana Loki: Like Prometheus, but for Logs by Ganesh Vernekar
OSMC 2019 | Grafana Loki: Like Prometheus, but for Logs by Ganesh VernekarOSMC 2019 | Grafana Loki: Like Prometheus, but for Logs by Ganesh Vernekar
OSMC 2019 | Grafana Loki: Like Prometheus, but for Logs by Ganesh Vernekar
NETWAYS
 
Socket programming
Socket programmingSocket programming
Socket programming
chandramouligunnemeda
 
Java sockets
Java socketsJava sockets
Java sockets
Stephen Pradeep
 
Html web rtc
Html web rtcHtml web rtc
Html web rtc
AbhishekMondal42
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
Jonathan Gomez
 
GRPC 101 - DevFest Belgium 2016
GRPC 101 - DevFest Belgium 2016GRPC 101 - DevFest Belgium 2016
GRPC 101 - DevFest Belgium 2016
Alex Van Boxel
 
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, GoogleBringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Ambassador Labs
 
The Conf 2019 - Elixir - Emerson Macedo
The Conf 2019 - Elixir - Emerson MacedoThe Conf 2019 - Elixir - Emerson Macedo
The Conf 2019 - Elixir - Emerson Macedo
Emerson Macedo
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpc
Fan Robbin
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
ciklum_ods
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagar
Nitish Nagar
 
Generating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPCGenerating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPC
C4Media
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer Protocol
Sougata Pal
 
gRPC
gRPCgRPC
gRPC
Majid Alaeinia
 
Networking chapter III
Networking chapter IIINetworking chapter III
Networking chapter III
Jayakumar Balasubramanian
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using java
UC San Diego
 
Network Socket Programming with JAVA
Network Socket Programming with JAVANetwork Socket Programming with JAVA
Network Socket Programming with JAVA
Dudy Ali
 
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward
 
MPI Tutorial
MPI TutorialMPI Tutorial
MPI Tutorial
Dhanashree Prasad
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In Java
Ankur Agrawal
 
OSMC 2019 | Grafana Loki: Like Prometheus, but for Logs by Ganesh Vernekar
OSMC 2019 | Grafana Loki: Like Prometheus, but for Logs by Ganesh VernekarOSMC 2019 | Grafana Loki: Like Prometheus, but for Logs by Ganesh Vernekar
OSMC 2019 | Grafana Loki: Like Prometheus, but for Logs by Ganesh Vernekar
NETWAYS
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
Jonathan Gomez
 
GRPC 101 - DevFest Belgium 2016
GRPC 101 - DevFest Belgium 2016GRPC 101 - DevFest Belgium 2016
GRPC 101 - DevFest Belgium 2016
Alex Van Boxel
 
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, GoogleBringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Ambassador Labs
 
The Conf 2019 - Elixir - Emerson Macedo
The Conf 2019 - Elixir - Emerson MacedoThe Conf 2019 - Elixir - Emerson Macedo
The Conf 2019 - Elixir - Emerson Macedo
Emerson Macedo
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpc
Fan Robbin
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
ciklum_ods
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagar
Nitish Nagar
 
Generating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPCGenerating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPC
C4Media
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer Protocol
Sougata Pal
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using java
UC San Diego
 
Network Socket Programming with JAVA
Network Socket Programming with JAVANetwork Socket Programming with JAVA
Network Socket Programming with JAVA
Dudy Ali
 
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward
 

Similar to What I learned about APIs in my first year at Google (20)

Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
Tim Burks
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPC
Tim Burks
 
XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)
Kiran Jonnalagadda
 
Communication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureCommunication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & Future
Muhammad Ali
 
Modern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in GolangModern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in Golang
OmidHojabri1
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays
 
What you need to know about .NET Core 3.0 and beyond
What you need to know about .NET Core 3.0 and beyondWhat you need to know about .NET Core 3.0 and beyond
What you need to know about .NET Core 3.0 and beyond
Jon Galloway
 
UNIT V - The OMG way-system object model Notes.ppt
UNIT V - The OMG way-system object model Notes.pptUNIT V - The OMG way-system object model Notes.ppt
UNIT V - The OMG way-system object model Notes.ppt
AsmitSilhare1
 
Creating microservices architectures using node.js and Kubernetes
Creating microservices architectures using node.js and KubernetesCreating microservices architectures using node.js and Kubernetes
Creating microservices architectures using node.js and Kubernetes
Paul Goldbaum
 
Cloud Presentation.pdf
Cloud Presentation.pdfCloud Presentation.pdf
Cloud Presentation.pdf
MandanaHazeri
 
Web Service
Web ServiceWeb Service
Web Service
Ashwani kumar
 
Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)
Tim Burks
 
Rpc (Distributed computing)
Rpc (Distributed computing)Rpc (Distributed computing)
Rpc (Distributed computing)
Sri Prasanna
 
Chapter2 Application
Chapter2 ApplicationChapter2 Application
Chapter2 Application
Diego Corrales
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
Neil Ghosh
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Tim Burks
 
REST APIs and MQ
REST APIs and MQREST APIs and MQ
REST APIs and MQ
Matt Leming
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
Sri Prasanna
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studies
hushu
 
jkljklj
jkljkljjkljklj
jkljklj
hoefo
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
Tim Burks
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPC
Tim Burks
 
Communication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & FutureCommunication Mechanisms, Past, Present & Future
Communication Mechanisms, Past, Present & Future
Muhammad Ali
 
Modern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in GolangModern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in Golang
OmidHojabri1
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays
 
What you need to know about .NET Core 3.0 and beyond
What you need to know about .NET Core 3.0 and beyondWhat you need to know about .NET Core 3.0 and beyond
What you need to know about .NET Core 3.0 and beyond
Jon Galloway
 
UNIT V - The OMG way-system object model Notes.ppt
UNIT V - The OMG way-system object model Notes.pptUNIT V - The OMG way-system object model Notes.ppt
UNIT V - The OMG way-system object model Notes.ppt
AsmitSilhare1
 
Creating microservices architectures using node.js and Kubernetes
Creating microservices architectures using node.js and KubernetesCreating microservices architectures using node.js and Kubernetes
Creating microservices architectures using node.js and Kubernetes
Paul Goldbaum
 
Cloud Presentation.pdf
Cloud Presentation.pdfCloud Presentation.pdf
Cloud Presentation.pdf
MandanaHazeri
 
Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)
Tim Burks
 
Rpc (Distributed computing)
Rpc (Distributed computing)Rpc (Distributed computing)
Rpc (Distributed computing)
Sri Prasanna
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
Neil Ghosh
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Tim Burks
 
REST APIs and MQ
REST APIs and MQREST APIs and MQ
REST APIs and MQ
Matt Leming
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
Sri Prasanna
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studies
hushu
 
jkljklj
jkljkljjkljklj
jkljklj
hoefo
 
Ad

More from Tim Burks (9)

Governing APIs at Scale
Governing APIs at ScaleGoverning APIs at Scale
Governing APIs at Scale
Tim Burks
 
Usable APIs at Scale
Usable APIs at ScaleUsable APIs at Scale
Usable APIs at Scale
Tim Burks
 
Build your next REST API with gRPC
Build your next REST API with gRPCBuild your next REST API with gRPC
Build your next REST API with gRPC
Tim Burks
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPC
Tim Burks
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
Tim Burks
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-Side
Tim Burks
 
Interpreting Objective C
Interpreting Objective CInterpreting Objective C
Interpreting Objective C
Tim Burks
 
Deep Geek Diving into the iPhone OS and Frameworks
Deep Geek Diving into the iPhone OS and FrameworksDeep Geek Diving into the iPhone OS and Frameworks
Deep Geek Diving into the iPhone OS and Frameworks
Tim Burks
 
Building Open Radar
Building Open RadarBuilding Open Radar
Building Open Radar
Tim Burks
 
Governing APIs at Scale
Governing APIs at ScaleGoverning APIs at Scale
Governing APIs at Scale
Tim Burks
 
Usable APIs at Scale
Usable APIs at ScaleUsable APIs at Scale
Usable APIs at Scale
Tim Burks
 
Build your next REST API with gRPC
Build your next REST API with gRPCBuild your next REST API with gRPC
Build your next REST API with gRPC
Tim Burks
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPC
Tim Burks
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
Tim Burks
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-Side
Tim Burks
 
Interpreting Objective C
Interpreting Objective CInterpreting Objective C
Interpreting Objective C
Tim Burks
 
Deep Geek Diving into the iPhone OS and Frameworks
Deep Geek Diving into the iPhone OS and FrameworksDeep Geek Diving into the iPhone OS and Frameworks
Deep Geek Diving into the iPhone OS and Frameworks
Tim Burks
 
Building Open Radar
Building Open RadarBuilding Open Radar
Building Open Radar
Tim Burks
 
Ad

Recently uploaded (20)

Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 

What I learned about APIs in my first year at Google

  • 1. What I learned about APIs in my first year at Google (Protocol Buffers and gRPC) [email protected]
  • 14. I was an “indie” iOS developer
  • 18. What I knew about APIs before I joined Google: APIs are essential. APIs must be tested to be sure they work. APIs must be designed appropriately for their applications.
  • 19. Google Cloud Platform The Fallacies of Distributed Computing The network is reliable Latency is zero Bandwidth is infinite The network is secure https://blogs.oracle.com/jag/resource/Fallacies.html Topology doesn't change There is one administrator Transport cost is zero The network is homogeneous
  • 20. There’s this wall. Conway’s Law: “organizations which design systems... are constrained to produce designs which are copies of the communication structures of these organizations.”
  • 21. Cloud platforms can help us tear down that wall.
  • 23. When you do a lot of something, you want to pay attention to it. You develop a language for describing it. You optimize it. You standardize it. You make it flexible, so it can adapt to changes.
  • 24. Protocol buffers are a language-neutral, platform-neutral, extensible mechanism for serializing structured data. Implemented in many languages, sometimes many times...
  • 25. “Protocol Buffers” means several things 1. A serialization mechanism 2. An interface description language 3. A methodology
  • 26. Protocol Buffer Serialization It’s just a stream of bytes [field_number<<3 + wire_type] [length if necessary] [data]... $ hexdump /tmp/request.pb 0000000 0a 05 68 65 6c 6c 6f 0a is “0000 1010”, so field_number = 1 wire_type = 2
  • 27. echo.proto syntax = "proto3"; package echo; service Echo { rpc Get(EchoRequest) returns (EchoResponse) {} rpc Update(stream EchoRequest) returns (stream EchoResponse) {} } message EchoRequest { string text = 1; } message EchoResponse { string text = 1; }
  • 29. The Protocol Buffer methodology $ protoc echo.proto --go_out=. $ more echo.pb.go // Code generated by protoc-gen-go. // source: echo.proto // DO NOT EDIT! ...
  • 30. A remote procedure call (RPC) framework layered on HTTP/2 Enables client and server applications to communicate transparently Client “calls” methods on a Server (which may be on a different machine) as if it were a local service Makes it easy to build heterogeneous distributed systems Separate full implementations in C, Java, and Go.
  • 32. Unary (nonstreaming) API syntax = “proto3”; message HelloRequest { string name = 1; } message HelloReply { string message = 1; } service HelloService { rpc SayHello(HelloRequest) returns (HelloReply); } Unary API: Client sends a request, server sends a response
  • 33. Streaming APIs - 1 (of 3) Client Streaming syntax = “proto3”; message Latency { string name = 1; double val = 2; } message Histogram { string name = 1 double p99 = 2; double p999 = 3; double avg = 4; } service MetricsService { rpc ReportLateny(stream Latency) returns Histogram; } Client Streaming API: Client sends multiple messages; Server sends one response (Note: Server may choose to send the response before all the client messages are received)
  • 34. Streaming APIs - 2 (of 3) Server Streaming syntax = “proto3”; message StockRequest { string stocksymbol = 1; } message StockResponse { double price = 1; } service StockTickerService { rpc GetTicker(StockRequest) returns (stream StockResponse); } Server Streaming API: Client sends one message; Server sends multiple messages
  • 35. Streaming APIs - 3 (of 3) Bidirectional Streaming syntax = “proto3”; message ChatMessage { string msg = 1; } service ChatService { rpc Chat(stream ChatMessage) returns (stream ChatMessage); } Bidi Streaming API: Client and Server can send multiple messages to each other (Note: Client and server can independently send messages to each other i.e they do not have to wait for receiving a client message before sending a message)
  • 36. Google Cloud Platform Some gRPC Adopters
  • 37. Google Cloud Platform Netflix deprecated its RPC framework in favor of gRPC: “Our team has instead building an RPC solution on top of gRPC. We are doing this transition for two main reasons: multi-language support and better extensibility/composability through request interceptors. That’s our current plan moving forward.” https://github.com/Netflix/ribbon gRPC Adopters
  • 38. We’re building Swift support for gRPC.
  • 39. We are working to bring Protocol Buffers and gRPC support into OpenAPI.