SlideShare a Scribd company logo
1 of 26
Download to read offline
Google confidential │ Do not
distribute
Google confidential │ Do not
distribute
gRPC:
A multi-platform RPC system
Louis Ryan
26th February 2016
Google confidential │ Do not
distribute
Microservices at Google
~O(1010
) RPCs per second.
Images by Connie
Zhou
Open source on Github for C, C++, Java, Node.js,
Python, Ruby, Go, C#, PHP, Objective-C
gRPC core
gRPC java
OVERVIEW
gRPC is ...
Open Source RPC framework that makes it easy to build a heterogenous distributed system.
● Free as in beer! (and licensing)
● Based on HTTP/2 today (multiplexed, works with the Internet)
● Payload agnostic (we’ve implemented proto)
● Streaming & Flow-Controlled
● Designed for harsh environments (timeout, lameducking, load-balancing,
cancellation, …)
● Support in 10 languages & first class mobile support
● Layered & Pluggable - Bring your own monitoring, auth, naming, load
balancing ...
● Core features and protocol are fully specified
● Rolled out for public Google APIs and widely used internally
○ Lots of mobile adoption
● Approaching 1.0 (GA) release in all languages
○ Stable APIs for key features
● Benefit of layering on top of HTTP/2 standard
○ Interoperability with 3rd party proxies, tools, libraries..
○ WHATWG Fetch
Project Status
Multiple Languages
C/C++
HTTP/2HTTP/1.1
http://www.http2demo.io/
message SubscribeRequest {
string topic = 1;
}
message Event {
string details = 1;
}
service Topics {
rpc Subscribe(SubscribeRequest)
returns (stream Event);
}
IDL (Interface definition language)
Describe once and generate interfaces
for any language.
Data Model
Structure of the request and response.
Binary format for network transmission.
Wire Format
Protocol Buffers
● Three complete stacks: C/C++, Java and Go.
● Other language implementations wrap C-Runtime libraries.
○ Hand-written wrappers to maintain language idioms
● Why wrap C?
○ Development costs & Implementation Consistency
○ Performance
○ Feature evolution
● Easy one line installation via packages e.g npm install grpc
Implementation Details
USE CASES
Google confidential │ Do not
distribute
Use Cases
Client-server
communication
Access Google Cloud
Services
Build distributed
applications
Images by Connie
Zhou
• In data-centers
• In public/private cloud
• Clients and servers
across:
• Mobile
• Web
• Cloud
• Also
• Embedded
systems, IoT
• From GCP
• From Android and iOS
devices
• From everywhere else
HOW TO GET STARTED
● Install
○ apt-get install protobuf-compiler
○ pip install grpcio
● Write the protos
● Use protoc to generate service interfaces, messages & stubs
● Implement services in server
● Client instantiates stub
● Test & Deploy
Typical development workflow
● Auth & Security - TLS [Mutual], Plugin auth mechanism (e.g. OAuth)
● Proxies - nghttp2, haproxy, Google LB, Nginx (in progress)
● Client-side load balancing - etcd, Zookeeper, Eureka, …
● Monitor & Trace - Zipkin, Google, DIY
● Mobile - Reconnect, QUIC
● Web - REST Adapter, WHATWG Fetch
● API Evolution - Protobuf, Versioning
Advanced Deployment...
ARCHITECTURE
gRPC Core
Http 2.0
SSL
Code Generated API
Planned in:
C/C++, Java, GoApplication Layer
Framework Layer
Transport Layer
Architecture: Native Implementation in Language
Generic Low Level API in C
Python
Code-Generated Language Idiomatic API
Obj-C, C#, C++,
...
Ruby PHPPython
gRPC Core in C
Http 2.0
SSL
Language Bindings
Code Generated
Ruby PHP
Obj-C, C#,
C++,...
Application Layer
Framework Layer
Transport Layer
Architecture: Derived Stack
Wire Implementation across languages
gRPC Core
Http 2.0
SSL
Code Generated API
Auth Architecture and API
Credentials API
Auth-Credentials
Implementation
AuthPluginAPI
● Generic mechanism for attaching metadata to requests and responses
● Built into the gRPC protocol - always available
● Plugin API to attach “bearer tokens” to requests for Auth
○ OAuth2 access tokens
○ OIDC Id Tokens
● Session state for specific Auth mechanisms is encapsulated in an Auth-
credentials object
Metadata and Auth
ADVANCED FEATURES
gRPC: Naming
client nameserver
servers
name
addresses, ...
gRPC: LoadBalancing
client
LB
Controller
servers
Control RPC
address-list
ROADMAP..sorta !
Initial Alpha
Release
Beta
Release
Stability,
Easy
installation,
1.0 release
Q1 ‘16
Roadmap: Timeline
Q2 ‘15 Q3 ‘15,
Q4’15
Q1 ‘15 Q2 ‘16 Q3 16
Additional
Alpha
Releases
Load balancing,
Naming,
Performance
Debugging and
Tracing,
Browser
support
Thank you!
Thank you!
Twitter: @grpcio
Site: grpc.io
Group: grpc-io@googlegroups.com

More Related Content

What's hot

What's hot (20)

What is gRPC introduction gRPC Explained
What is gRPC introduction gRPC ExplainedWhat is gRPC introduction gRPC Explained
What is gRPC introduction gRPC Explained
 
Inter-Process Communication in Microservices using gRPC
Inter-Process Communication in Microservices using gRPCInter-Process Communication in Microservices using gRPC
Inter-Process Communication in Microservices using gRPC
 
gRPC with java
gRPC with javagRPC with java
gRPC with java
 
gRPC - RPC rebirth?
gRPC - RPC rebirth?gRPC - RPC rebirth?
gRPC - RPC rebirth?
 
gRPC
gRPC gRPC
gRPC
 
Building microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
 
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t... Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
Power-up services with gRPC
Power-up services with gRPCPower-up services with gRPC
Power-up services with gRPC
 
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-Side
 
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at SquaregRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at Square
 
Building your First gRPC Service
Building your First gRPC ServiceBuilding your First gRPC Service
Building your First gRPC Service
 
Designing APIs with OpenAPI Spec
Designing APIs with OpenAPI SpecDesigning APIs with OpenAPI Spec
Designing APIs with OpenAPI Spec
 
Building Microservices with gRPC and NATS
Building Microservices with gRPC and NATSBuilding Microservices with gRPC and NATS
Building Microservices with gRPC and NATS
 
gRPC in Go
gRPC in GogRPC in Go
gRPC in Go
 
Modern UI Development With Node.js
Modern UI Development With Node.jsModern UI Development With Node.js
Modern UI Development With Node.js
 
Protocol Buffers
Protocol BuffersProtocol Buffers
Protocol Buffers
 
GoLang Introduction
GoLang IntroductionGoLang Introduction
GoLang Introduction
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
 

Similar to gRPC Overview

What's New in NGINX Plus R10?
What's New in NGINX Plus R10?What's New in NGINX Plus R10?
What's New in NGINX Plus R10?
NGINX, Inc.
 
Google api應用入門
Google api應用入門Google api應用入門
Google api應用入門
Simon Su
 

Similar to gRPC Overview (20)

USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthUSENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
 
Cloud native IPC for Microservices Workshop @ Containerdays 2022
Cloud native IPC for Microservices Workshop @ Containerdays 2022Cloud native IPC for Microservices Workshop @ Containerdays 2022
Cloud native IPC for Microservices Workshop @ Containerdays 2022
 
Netflix Open Source: Building a Distributed and Automated Open Source Program
Netflix Open Source:  Building a Distributed and Automated Open Source ProgramNetflix Open Source:  Building a Distributed and Automated Open Source Program
Netflix Open Source: Building a Distributed and Automated Open Source Program
 
Building a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at NetflixBuilding a Distributed & Automated Open Source Program at Netflix
Building a Distributed & Automated Open Source Program at Netflix
 
Go at uber
Go at uberGo at uber
Go at uber
 
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud RunDesigning flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
Designing flexible apps deployable to App Engine, Cloud Functions, or Cloud Run
 
OSCamp 2019 | #3 Ansible: Foreman Discovery by Adam Ruzicka
OSCamp 2019 | #3 Ansible: Foreman Discovery by Adam RuzickaOSCamp 2019 | #3 Ansible: Foreman Discovery by Adam Ruzicka
OSCamp 2019 | #3 Ansible: Foreman Discovery by Adam Ruzicka
 
Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
 
State of Big Data on ARM64 / AArch64 - Apache Bigtop
State of Big Data on ARM64 / AArch64 - Apache BigtopState of Big Data on ARM64 / AArch64 - Apache Bigtop
State of Big Data on ARM64 / AArch64 - Apache Bigtop
 
What's New in NGINX Plus R10?
What's New in NGINX Plus R10?What's New in NGINX Plus R10?
What's New in NGINX Plus R10?
 
Introduction to serverless computing on Google Cloud
Introduction to serverless computing on Google CloudIntroduction to serverless computing on Google Cloud
Introduction to serverless computing on Google Cloud
 
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
 
LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2LCU14 310- Cisco ODP v2
LCU14 310- Cisco ODP v2
 
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWT
 
Google api應用入門
Google api應用入門Google api應用入門
Google api應用入門
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIs
 
CI/CD on Google Cloud Platform
CI/CD on Google Cloud PlatformCI/CD on Google Cloud Platform
CI/CD on Google Cloud Platform
 
Building Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the CloudBuilding Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the Cloud
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 

gRPC Overview

  • 1. Google confidential │ Do not distribute Google confidential │ Do not distribute gRPC: A multi-platform RPC system Louis Ryan 26th February 2016
  • 2. Google confidential │ Do not distribute Microservices at Google ~O(1010 ) RPCs per second. Images by Connie Zhou
  • 3. Open source on Github for C, C++, Java, Node.js, Python, Ruby, Go, C#, PHP, Objective-C gRPC core gRPC java
  • 5. gRPC is ... Open Source RPC framework that makes it easy to build a heterogenous distributed system. ● Free as in beer! (and licensing) ● Based on HTTP/2 today (multiplexed, works with the Internet) ● Payload agnostic (we’ve implemented proto) ● Streaming & Flow-Controlled ● Designed for harsh environments (timeout, lameducking, load-balancing, cancellation, …) ● Support in 10 languages & first class mobile support ● Layered & Pluggable - Bring your own monitoring, auth, naming, load balancing ...
  • 6. ● Core features and protocol are fully specified ● Rolled out for public Google APIs and widely used internally ○ Lots of mobile adoption ● Approaching 1.0 (GA) release in all languages ○ Stable APIs for key features ● Benefit of layering on top of HTTP/2 standard ○ Interoperability with 3rd party proxies, tools, libraries.. ○ WHATWG Fetch Project Status
  • 9. message SubscribeRequest { string topic = 1; } message Event { string details = 1; } service Topics { rpc Subscribe(SubscribeRequest) returns (stream Event); } IDL (Interface definition language) Describe once and generate interfaces for any language. Data Model Structure of the request and response. Binary format for network transmission. Wire Format Protocol Buffers
  • 10. ● Three complete stacks: C/C++, Java and Go. ● Other language implementations wrap C-Runtime libraries. ○ Hand-written wrappers to maintain language idioms ● Why wrap C? ○ Development costs & Implementation Consistency ○ Performance ○ Feature evolution ● Easy one line installation via packages e.g npm install grpc Implementation Details
  • 12. Google confidential │ Do not distribute Use Cases Client-server communication Access Google Cloud Services Build distributed applications Images by Connie Zhou • In data-centers • In public/private cloud • Clients and servers across: • Mobile • Web • Cloud • Also • Embedded systems, IoT • From GCP • From Android and iOS devices • From everywhere else
  • 13. HOW TO GET STARTED
  • 14. ● Install ○ apt-get install protobuf-compiler ○ pip install grpcio ● Write the protos ● Use protoc to generate service interfaces, messages & stubs ● Implement services in server ● Client instantiates stub ● Test & Deploy Typical development workflow
  • 15. ● Auth & Security - TLS [Mutual], Plugin auth mechanism (e.g. OAuth) ● Proxies - nghttp2, haproxy, Google LB, Nginx (in progress) ● Client-side load balancing - etcd, Zookeeper, Eureka, … ● Monitor & Trace - Zipkin, Google, DIY ● Mobile - Reconnect, QUIC ● Web - REST Adapter, WHATWG Fetch ● API Evolution - Protobuf, Versioning Advanced Deployment...
  • 17. gRPC Core Http 2.0 SSL Code Generated API Planned in: C/C++, Java, GoApplication Layer Framework Layer Transport Layer Architecture: Native Implementation in Language
  • 18. Generic Low Level API in C Python Code-Generated Language Idiomatic API Obj-C, C#, C++, ... Ruby PHPPython gRPC Core in C Http 2.0 SSL Language Bindings Code Generated Ruby PHP Obj-C, C#, C++,... Application Layer Framework Layer Transport Layer Architecture: Derived Stack
  • 19. Wire Implementation across languages gRPC Core Http 2.0 SSL Code Generated API Auth Architecture and API Credentials API Auth-Credentials Implementation AuthPluginAPI
  • 20. ● Generic mechanism for attaching metadata to requests and responses ● Built into the gRPC protocol - always available ● Plugin API to attach “bearer tokens” to requests for Auth ○ OAuth2 access tokens ○ OIDC Id Tokens ● Session state for specific Auth mechanisms is encapsulated in an Auth- credentials object Metadata and Auth
  • 25. Initial Alpha Release Beta Release Stability, Easy installation, 1.0 release Q1 ‘16 Roadmap: Timeline Q2 ‘15 Q3 ‘15, Q4’15 Q1 ‘15 Q2 ‘16 Q3 16 Additional Alpha Releases Load balancing, Naming, Performance Debugging and Tracing, Browser support
  • 26. Thank you! Thank you! Twitter: @grpcio Site: grpc.io Group: grpc-io@googlegroups.com