SlideShare a Scribd company logo
boilerplate to high performance scalable APIs
gRPC
Robert Kubis
Developer Advocate
2@hostirosti @grpcio
Robert Kubis
Developer Advocate
Google Cloud Platform
London, UK
hostirosti
github.com/hostirosti
About me
Agenda
Motivation (Microservices)
HTTP/2
Protobuf
gRPC
1
2
3
4
4
Microservices
5@hostirosti @grpcio
A B
C D
Decomposing Monolithic apps
6@hostirosti @grpcio
A B
C
D
Decomposing Monolithic apps
7@hostirosti @grpcio
A B
C
DgRPC
Decomposing Monolithic apps
8
HTTP/2
9@hostirosti @grpcio
Today statistics show that there are on average:
12 distinct hosts per page
78 distinct requests per page
1,232 KB transferred per page
Resulting in typical render times of 2.6-5.6 seconds
(50th and 90th percentiles).
So what’s up with HTTP/1?
* Numbers are medians, based on latest HTTP Archive crawl data.
10@hostirosti @grpcio
HTTP Pipelining
Queue responses not requests
Domain Sharding
Need more than 6 connections per origin?
Add more origins!
Concatenation and Spriting
Multiple JavaScript/CSS/Image files
combined into a single resource
Resource Inlining
Inline JS/CSS/Images in the page
img1.example.com
img2.example.com
img3.example.com
...
Coping Strategies
11@hostirosti @grpcio
HTTP Pipelining
Head of Line blocking
Domain Sharding
Over sharding can kill performance
Concatenation and Spriting
Increased complexity, can hurt cache
performance and page load
Resource Inlining
Can hurt cache performance, hard to get
granularity right
img1.example.com
img2.example.com
img3.example.com
...
Copying Strategies - The downsides
12
● Improve end-user perceived latency
● Address the "head of line blocking"
● Not require multiple connections
● Retain the semantics of HTTP/1.1
Ilya Grigorik - hpbn.co/http2 - High Performance Browser Networking
"HTTP/2 is a protocol designed for low-
latency transport of content
over the World Wide Web"
13@hostirosti @grpcio
One TCP connection
Request → Stream
Streams are multiplexed
Streams are prioritized
Binary framing layer
Prioritization
Flow control
Server push
Header compression
HTTP/2 in one slide ...
14
“... we’re not replacing all of HTTP — the
methods, status codes, and most of the
headers you use today will be the same.
Instead, we’re redefining how it gets used
“on the wire” so it’s more efficient, and so
that it is more gentle to the Internet itself ....”
- Mark Nottingham (HTTPbis chair)
15@hostirosti @grpcio
Sits between Socket interface and the API
HTTP messages are decomposed into one or
more frames
HEADERS for meta-data
DATA for payload
RST_STREAM to cancel
…
Each frame has a common header
9-byte, length prefixed
Easy and efficient to parse
HTTP/2 binary framing 101
16@hostirosti @grpcio
Basic data flow in HTTP 2.0...
17@hostirosti @grpcio
Streams are multiplexed, because frames can
be interleaved
All frames (e.g. HEADERS, DATA, etc) are sent
over single TCP connection
Frame delivery is prioritized based on stream
dependencies and weights
DATA frames are subject to per-stream and
connection flow control
Basic data flow in HTTP 2.0...
18@hostirosti @grpcio
Each stream can have a weight
[1-256] integer value
Each stream can have a dependency
parent is another stream ID
1. E.g.. style.css (“A”) should get 2/3rd’s of available resources as compared to logo.jpg (“B”)
2. E.g.. product-photo-1.jpg (“D”) should be delivered before product-photo-2.jpg (“C”)
NOTE: Prioritization is an advisory optimization hint to the server
Stream prioritization in HTTP/2...
19@hostirosti @grpcio
HTTP/2 server: “You asked for /product/123,
I know you’ll also need app.js and product-
photo-1.jpg, so… I promise to deliver these to
you, no need to ask for them. That is, unless
you decline or cancel.”
GET /product/123
/product/123
/app.js
/product-photo-1.jpg
● Server push is optional and can be disabled by the client
● Server push is subject to flow control - e.g. “you can only push 5Kb”
● Pushed resources can be cached and prioritized individually
Server push, “because you’ll also need…”
20@hostirosti @grpcio
HTTP/2 client: “I want photo.jpg, please send
the first 20KB.”
HTTP/2 server: “Ok, 20KB… pausing stream
until you tell me to send more.”
HTTP/2 client: “Send me the rest now.”
GET /product-photo.jpg
/product-photo.jpg
/product-photo.jpg
WINDOW_UPDATE
● Flow control allows the client to pause stream delivery, and resume it later
● Flow control is a “credit-based” scheme
○ Sending DATA frames decrements the window
○ WINDOW_UPDATE frames update the window
Per-stream flow control
21@hostirosti @grpcio
● Literal values are (optionally) encoded with a static Huffman code
● Previously sent values are (optionally) indexed
○ e.g. “2” in above example expands to “method: GET”
HPACK header compression
22
Protocol Buffers
23@hostirosti @grpcio
Structured representation of data
Google's lingua franca for data
48k+ Message Types
12k+ Proto files
Evolutionary Development
Incrementally solved problems, Now used for:
RPC Systems
Persistent Data Storage
What are Protocol Buffers?
24@hostirosti @grpcio
Protocol buffers:
Efficient and compact binary data representation
Clear compatibility rules; can easily be extended over time
Generates idiomatic, easy to use classes for many languages
Strongly typed; less error prone
Why Protocol Buffers?
25@hostirosti @grpcio
Protocol Buffers also are:
No use as a markup language
Not human readable (native format)
Only meaningful if you have the message definition
Why not?
26@hostirosti @grpcio
Uniquely numbered fields
Typed
Hierarchical Structure
Optional and Repeated fields
Extensible without breaking backward compatibility
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
enum PhoneType {
MOBILE = 0;
HOME = 1;
WORK = 2;
}
message PhoneNumber {
required string number = 1;
optional PhoneType type = 2 [default = HOME];
}
repeated PhoneNumber phone = 4;
}
Message Format (proto2)
27@hostirosti @grpcio
Protocol Buffers language version 3
Specified by syntax = “proto3”;
All fields are optional in proto3
No user specified default values
No groups (FYI for those that use them)
syntax = “proto3”;
message Person {
string name = 1;
int32 id = 2;
string email = 3;
enum PhoneType {
MOBILE = 0;
HOME = 1;
WORK = 2;
}
message PhoneNumber {
string number = 1;
PhoneType type = 2;
}
repeated PhoneNumber phone = 4;
}
Message Format (proto3)
28@hostirosti @grpcio
Add new fields without breaking backwards-
compatibility
old implementations ignore the new fields
when parsing
In proto3 any field can be removed, but don’t
renumber existing fields
syntax = “proto3”;
message Person {
string name = 1;
int32 id = 2;
string email = 3;
address addr = 5;
message address {
string firstLine = 1;
string secondLine = 2;
string postalCode = 3;
string country = 4;
}
...
}
Extensible
29@hostirosti @grpcio
https://github.com/google/protobuf
Protocol Buffer Compiler
30
gRPC
31@hostirosti @grpcio
gRPC goals
Build an open source, standards-based, best-of-breed, feature-rich RPC system
Enable developers to build
microservice-based
applications
Build an open source, standards-based, best-of-breed, feature-rich RPC system
Create easy-to-use, efficient
and idiomatic libraries
micro-servicesperformant and scalableefficient and idiomatic
Provide a performant and
scalable RPC framework
32@hostirosti @grpcio
IDL to describe the API
Automatically generated servers and clients in 10+
languages
Takes advantage of feature set of HTTP/2
Lightweight open connections
Point to point
Streaming! Bidirectional streaming!
gRPC in a nutshell
33@hostirosti @grpcio
gRPC client/server architecture
34@hostirosti @grpcio
Define a service in a .proto file using Protocol
Buffers IDL
Generate server and client code using the
protocol buffer compiler with grpc plugin
Use the gRPC API to write a simple client and
server for your service in the languages of your
choice
Getting Started
35@hostirosti @grpcio
The most common use-case is a unary request-response RPC
Msg1
MsgA
Client Server
RPC Messages
36@hostirosti @grpcio
service RouteGuide {
rpc GetFeature(Point) returns (Feature);
}
message Point {
int32 latitude = 1;
int32 longitude = 2;
}
message Feature {
string name = 1;
Point location = 2;
}
Service Definition
37@hostirosti @grpcio
Msg1Msg2Msg3
MsgA MsgB
Metadata
Metadata Metadata
Client Server
The second most common use-case is sending multiple request or response messages in
the context of a single RPC call
Ordered Bidirectional Streaming RPC
38@hostirosti @grpcio
service RouteGuide {
rpc ListFeatures (Rectangle) returns (stream Features);
...
}
message Rectangle {
Point lo = 1;
Point hi = 2;
}
Server Streaming RPC Definition
39@hostirosti @grpcio
service RouteGuide {
rpc RecordRoute (stream Point) returns (RouteSummary);
...
}
message RouteSummary {
int32 point_count = 1;
int32 feature_count = 2;
int32 distance = 3;
int32 elapsed_time = 4;
}
Client Streaming RPC Definition
40@hostirosti @grpcio
service RouteGuide {
rpc RouteChat (stream RouteNote) returns (stream RouteNote);
...
}
message RouteNote {
string location = 1;
string message = 2;
}
Bidirectional Streaming RPC Definition
41@hostirosti @grpcio
Implementations
● C core
○ Native bindings in C++, Node.js, Python, Ruby, ObjC, PHP, C#
● Java using Netty or OkHttp (+ inProcess for testing)
● Go
gRPC Language Support
42@hostirosti @grpcio
SSL/TLS
gRPC has SSL/TLS integration and promotes the use of SSL/TLS to authenticate the server, and encrypt
all the data exchanged between the client and the server. Optional mechanisms are available for clients
to provide certificates to accomplish mutual authentication.
OAuth 2.0
gRPC provides a generic mechanism to attach metadata to requests and responses. Can be used to
attach OAuth 2.0 Access Tokens to RPCs being made at a client.
Authentication
43@hostirosti @grpcio
Multi-language
Freedom to pick the language independently for each micro-service, based
on performance, library availability, team expertise etc
Loosely coupled development
Blocks of functionality can be broken off into separate MicroService. Allows
organic growth
High Performance
Make use of the strengths of HTTP/2 and Protocol Buffers
MicroServices using gRPC
44@hostirosti @grpcio
C++ Service
gRPC server
Golang Service
gRPC server
gRPC
Stub
Java Service
gRPC
Stub
Python Service
gRPC server
gRPC
Stub
Polyglot Microservices Architecture
45
Demo gRPC
Fingers crossed :)
46
Mobile
47@hostirosti @grpcio
Photo-sharing App
Mobile Clients communicate with gRPC endpoint
Clients for iOS and Android
https://cloud.google.com/solutions/mobile/image-management-mobile-apps-grpc
Abelana Mobile Sample App
48@hostirosti @grpcio
Abelana Architecture
49
Wrap-up
50@hostirosti @grpcio
grpc is Open Source
We want your help!
http://grpc.io/contribute
https://github.com/grpc
irc.freenode.net #grpc
@grpcio
grpc-io@googlegroups.com
51
@hostirosti @grpcio @googlecloud
Thank you! Danke und auf Wiedersehen :)

More Related Content

What's hot

Power-up services with gRPC
Power-up services with gRPCPower-up services with gRPC
Power-up services with gRPC
The Software House
 
gRPC in Go
gRPC in GogRPC in Go
gRPC in Go
Almog Baku
 
gRPC
gRPCgRPC
Building microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
Sathiyaseelan Muthu kumar
 
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
 
gRPC with java
gRPC with javagRPC with java
gRPC with java
Knoldus Inc.
 
GRPC.pptx
GRPC.pptxGRPC.pptx
GRPC.pptx
Afzal Juneja
 
REST vs gRPC: Battle of API's
REST vs gRPC: Battle of API'sREST vs gRPC: Battle of API's
REST vs gRPC: Battle of API's
Luram Archanjo
 
What is gRPC introduction gRPC Explained
What is gRPC introduction gRPC ExplainedWhat is gRPC introduction gRPC Explained
What is gRPC introduction gRPC Explained
jeetendra mandal
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer Protocol
Sougata Pal
 
Building your First gRPC Service
Building your First gRPC ServiceBuilding your First gRPC Service
Building your First gRPC Service
Jessie Barnett
 
Building High Performance APIs In Go Using gRPC And Protocol Buffers
Building High Performance APIs In Go Using gRPC And Protocol BuffersBuilding High Performance APIs In Go Using gRPC And Protocol Buffers
Building High Performance APIs In Go Using gRPC And Protocol Buffers
Shiju Varghese
 
gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!
Alex Borysov
 
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
Apigee | Google Cloud
 
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
Shiju Varghese
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golang
Ting-Li Chou
 
Kubernetes best practices with GKE
Kubernetes best practices with GKEKubernetes best practices with GKE
Kubernetes best practices with GKE
GDG Cloud Bengaluru
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
Kohei Tokunaga
 
Protocol Buffers
Protocol BuffersProtocol Buffers
Protocol Buffers
Knoldus Inc.
 

What's hot (20)

gRPC
gRPC gRPC
gRPC
 
Power-up services with gRPC
Power-up services with gRPCPower-up services with gRPC
Power-up services with gRPC
 
gRPC in Go
gRPC in GogRPC in Go
gRPC in Go
 
gRPC
gRPCgRPC
gRPC
 
Building microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-Side
 
gRPC with java
gRPC with javagRPC with java
gRPC with java
 
GRPC.pptx
GRPC.pptxGRPC.pptx
GRPC.pptx
 
REST vs gRPC: Battle of API's
REST vs gRPC: Battle of API'sREST vs gRPC: Battle of API's
REST vs gRPC: Battle of API's
 
What is gRPC introduction gRPC Explained
What is gRPC introduction gRPC ExplainedWhat is gRPC introduction gRPC Explained
What is gRPC introduction gRPC Explained
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer Protocol
 
Building your First gRPC Service
Building your First gRPC ServiceBuilding your First gRPC Service
Building your First gRPC Service
 
Building High Performance APIs In Go Using gRPC And Protocol Buffers
Building High Performance APIs In Go Using gRPC And Protocol BuffersBuilding High Performance APIs In Go Using gRPC And Protocol Buffers
Building High Performance APIs In Go Using gRPC And Protocol Buffers
 
gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!
 
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
 
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
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golang
 
Kubernetes best practices with GKE
Kubernetes best practices with GKEKubernetes best practices with GKE
Kubernetes best practices with GKE
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
 
Protocol Buffers
Protocol BuffersProtocol Buffers
Protocol Buffers
 

Similar to Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.talks 2015

The new (is it really ) api stack
The new (is it really ) api stackThe new (is it really ) api stack
The new (is it really ) api stack
Red Hat
 
Enabling Googley microservices with HTTP/2 and gRPC.
Enabling Googley microservices with HTTP/2 and gRPC.Enabling Googley microservices with HTTP/2 and gRPC.
Enabling Googley microservices with HTTP/2 and gRPC.
Alex Borysov
 
Introduction to gRPC - Mete Atamel - Codemotion Rome 2017
Introduction to gRPC - Mete Atamel - Codemotion Rome 2017Introduction to gRPC - Mete Atamel - Codemotion Rome 2017
Introduction to gRPC - Mete Atamel - Codemotion Rome 2017
Codemotion
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
Tim Burks
 
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at GoogleWhat I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
Tim Burks
 
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
 
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure WebLinux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
All Things Open
 
CSU33012-I-microservices.pdf
CSU33012-I-microservices.pdfCSU33012-I-microservices.pdf
CSU33012-I-microservices.pdf
Ricky Garg
 
.NET Core Today and Tomorrow
.NET Core Today and Tomorrow.NET Core Today and Tomorrow
.NET Core Today and Tomorrow
Jon Galloway
 
Networking in Java
Networking in JavaNetworking in Java
Networking in Java
Tushar B Kute
 
NP-lab-manual (1).pdf
NP-lab-manual (1).pdfNP-lab-manual (1).pdf
NP-lab-manual (1).pdf
RaviRajput416403
 
NP-lab-manual.pdf
NP-lab-manual.pdfNP-lab-manual.pdf
NP-lab-manual.pdf
RaviRajput416403
 
APIs at the Edge
APIs at the EdgeAPIs at the Edge
APIs at the Edge
Red Hat
 
NP-lab-manual.docx
NP-lab-manual.docxNP-lab-manual.docx
NP-lab-manual.docx
RaviRajput416403
 
KrakenD API Gateway
KrakenD API GatewayKrakenD API Gateway
KrakenD API Gateway
Albert Lombarte
 
Introduction to back-end
Introduction to back-endIntroduction to back-end
Introduction to back-end
Mosaab Ehab
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
farshad33
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
sehrish saba
 
Socket Programming
Socket ProgrammingSocket Programming
Socket Programming
CEC Landran
 
Microservices Communication Patterns with gRPC
Microservices Communication Patterns with gRPCMicroservices Communication Patterns with gRPC
Microservices Communication Patterns with gRPC
WSO2
 

Similar to Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.talks 2015 (20)

The new (is it really ) api stack
The new (is it really ) api stackThe new (is it really ) api stack
The new (is it really ) api stack
 
Enabling Googley microservices with HTTP/2 and gRPC.
Enabling Googley microservices with HTTP/2 and gRPC.Enabling Googley microservices with HTTP/2 and gRPC.
Enabling Googley microservices with HTTP/2 and gRPC.
 
Introduction to gRPC - Mete Atamel - Codemotion Rome 2017
Introduction to gRPC - Mete Atamel - Codemotion Rome 2017Introduction to gRPC - Mete Atamel - Codemotion Rome 2017
Introduction to gRPC - Mete Atamel - Codemotion Rome 2017
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
 
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at GoogleWhat I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
 
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
 
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure WebLinux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
 
CSU33012-I-microservices.pdf
CSU33012-I-microservices.pdfCSU33012-I-microservices.pdf
CSU33012-I-microservices.pdf
 
.NET Core Today and Tomorrow
.NET Core Today and Tomorrow.NET Core Today and Tomorrow
.NET Core Today and Tomorrow
 
Networking in Java
Networking in JavaNetworking in Java
Networking in Java
 
NP-lab-manual (1).pdf
NP-lab-manual (1).pdfNP-lab-manual (1).pdf
NP-lab-manual (1).pdf
 
NP-lab-manual.pdf
NP-lab-manual.pdfNP-lab-manual.pdf
NP-lab-manual.pdf
 
APIs at the Edge
APIs at the EdgeAPIs at the Edge
APIs at the Edge
 
NP-lab-manual.docx
NP-lab-manual.docxNP-lab-manual.docx
NP-lab-manual.docx
 
KrakenD API Gateway
KrakenD API GatewayKrakenD API Gateway
KrakenD API Gateway
 
Introduction to back-end
Introduction to back-endIntroduction to back-end
Introduction to back-end
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
Socket Programming
Socket ProgrammingSocket Programming
Socket Programming
 
Microservices Communication Patterns with gRPC
Microservices Communication Patterns with gRPCMicroservices Communication Patterns with gRPC
Microservices Communication Patterns with gRPC
 

More from AboutYouGmbH

Tech talk 01.06.2017
Tech talk 01.06.2017Tech talk 01.06.2017
Tech talk 01.06.2017
AboutYouGmbH
 
Retention Strategies in Mobile E-Commerce
Retention Strategies in Mobile E-CommerceRetention Strategies in Mobile E-Commerce
Retention Strategies in Mobile E-Commerce
AboutYouGmbH
 
Rethinking Fashion E-Commerce
Rethinking Fashion E-CommerceRethinking Fashion E-Commerce
Rethinking Fashion E-Commerce
AboutYouGmbH
 
ABOUT YOU get on board
ABOUT YOU get on boardABOUT YOU get on board
ABOUT YOU get on board
AboutYouGmbH
 
Niels Leenheer - Weird browsers - code.talks 2015
Niels Leenheer - Weird browsers - code.talks 2015Niels Leenheer - Weird browsers - code.talks 2015
Niels Leenheer - Weird browsers - code.talks 2015
AboutYouGmbH
 
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
AboutYouGmbH
 
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
AboutYouGmbH
 
Lars Jankowfsky - Learn or Die - code.talks 2015
Lars Jankowfsky - Learn or Die - code.talks 2015Lars Jankowfsky - Learn or Die - code.talks 2015
Lars Jankowfsky - Learn or Die - code.talks 2015
AboutYouGmbH
 
Dr. Jeremias Rößler - Wenn Affen Testen - Das Ende der Bananensoftware - code...
Dr. Jeremias Rößler - Wenn Affen Testen - Das Ende der Bananensoftware - code...Dr. Jeremias Rößler - Wenn Affen Testen - Das Ende der Bananensoftware - code...
Dr. Jeremias Rößler - Wenn Affen Testen - Das Ende der Bananensoftware - code...
AboutYouGmbH
 
Zeljko Kvesic - Scrum in verteilten Teams / Agil über die Landesgrenzen - cod...
Zeljko Kvesic - Scrum in verteilten Teams / Agil über die Landesgrenzen - cod...Zeljko Kvesic - Scrum in verteilten Teams / Agil über die Landesgrenzen - cod...
Zeljko Kvesic - Scrum in verteilten Teams / Agil über die Landesgrenzen - cod...
AboutYouGmbH
 
Uwe Friedrichsen - CRDT und mehr - über extreme Verfügbarkeit und selbstheile...
Uwe Friedrichsen - CRDT und mehr - über extreme Verfügbarkeit und selbstheile...Uwe Friedrichsen - CRDT und mehr - über extreme Verfügbarkeit und selbstheile...
Uwe Friedrichsen - CRDT und mehr - über extreme Verfügbarkeit und selbstheile...
AboutYouGmbH
 
Kai Voigt - Big Data zum Anfassen - code.talks 2015
Kai Voigt - Big Data zum Anfassen - code.talks 2015Kai Voigt - Big Data zum Anfassen - code.talks 2015
Kai Voigt - Big Data zum Anfassen - code.talks 2015
AboutYouGmbH
 
Dr. Andreas Lattner - Aufsetzen skalierbarer Prognose- und Analysedienste mit...
Dr. Andreas Lattner - Aufsetzen skalierbarer Prognose- und Analysedienste mit...Dr. Andreas Lattner - Aufsetzen skalierbarer Prognose- und Analysedienste mit...
Dr. Andreas Lattner - Aufsetzen skalierbarer Prognose- und Analysedienste mit...
AboutYouGmbH
 
Marcel Hild - Spryker (e)commerce framework als Alternative zu traditioneller...
Marcel Hild - Spryker (e)commerce framework als Alternative zu traditioneller...Marcel Hild - Spryker (e)commerce framework als Alternative zu traditioneller...
Marcel Hild - Spryker (e)commerce framework als Alternative zu traditioneller...
AboutYouGmbH
 
Wolfram Kriesing - EcmaScript6 for real - code.talks 2015
Wolfram Kriesing - EcmaScript6 for real - code.talks 2015Wolfram Kriesing - EcmaScript6 for real - code.talks 2015
Wolfram Kriesing - EcmaScript6 for real - code.talks 2015
AboutYouGmbH
 
Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
 Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c... Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
AboutYouGmbH
 
Alex Korotkikh - From 0 to N: Lessons Learned - code.talks 2015
 Alex Korotkikh - From 0 to N: Lessons Learned - code.talks 2015 Alex Korotkikh - From 0 to N: Lessons Learned - code.talks 2015
Alex Korotkikh - From 0 to N: Lessons Learned - code.talks 2015
AboutYouGmbH
 
Christian Haider & Helge Nowak - Mehr Demokratie durch Haushaltstransparenz ...
 Christian Haider & Helge Nowak - Mehr Demokratie durch Haushaltstransparenz ... Christian Haider & Helge Nowak - Mehr Demokratie durch Haushaltstransparenz ...
Christian Haider & Helge Nowak - Mehr Demokratie durch Haushaltstransparenz ...
AboutYouGmbH
 
Bernhard Wick - appserver.io - code.talks 2015
 Bernhard Wick - appserver.io - code.talks 2015 Bernhard Wick - appserver.io - code.talks 2015
Bernhard Wick - appserver.io - code.talks 2015
AboutYouGmbH
 
Moritz Siuts & Robert von Massow - Data Pipeline mit Apache Kafka - code.tal...
 Moritz Siuts & Robert von Massow - Data Pipeline mit Apache Kafka - code.tal... Moritz Siuts & Robert von Massow - Data Pipeline mit Apache Kafka - code.tal...
Moritz Siuts & Robert von Massow - Data Pipeline mit Apache Kafka - code.tal...
AboutYouGmbH
 

More from AboutYouGmbH (20)

Tech talk 01.06.2017
Tech talk 01.06.2017Tech talk 01.06.2017
Tech talk 01.06.2017
 
Retention Strategies in Mobile E-Commerce
Retention Strategies in Mobile E-CommerceRetention Strategies in Mobile E-Commerce
Retention Strategies in Mobile E-Commerce
 
Rethinking Fashion E-Commerce
Rethinking Fashion E-CommerceRethinking Fashion E-Commerce
Rethinking Fashion E-Commerce
 
ABOUT YOU get on board
ABOUT YOU get on boardABOUT YOU get on board
ABOUT YOU get on board
 
Niels Leenheer - Weird browsers - code.talks 2015
Niels Leenheer - Weird browsers - code.talks 2015Niels Leenheer - Weird browsers - code.talks 2015
Niels Leenheer - Weird browsers - code.talks 2015
 
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
 
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
 
Lars Jankowfsky - Learn or Die - code.talks 2015
Lars Jankowfsky - Learn or Die - code.talks 2015Lars Jankowfsky - Learn or Die - code.talks 2015
Lars Jankowfsky - Learn or Die - code.talks 2015
 
Dr. Jeremias Rößler - Wenn Affen Testen - Das Ende der Bananensoftware - code...
Dr. Jeremias Rößler - Wenn Affen Testen - Das Ende der Bananensoftware - code...Dr. Jeremias Rößler - Wenn Affen Testen - Das Ende der Bananensoftware - code...
Dr. Jeremias Rößler - Wenn Affen Testen - Das Ende der Bananensoftware - code...
 
Zeljko Kvesic - Scrum in verteilten Teams / Agil über die Landesgrenzen - cod...
Zeljko Kvesic - Scrum in verteilten Teams / Agil über die Landesgrenzen - cod...Zeljko Kvesic - Scrum in verteilten Teams / Agil über die Landesgrenzen - cod...
Zeljko Kvesic - Scrum in verteilten Teams / Agil über die Landesgrenzen - cod...
 
Uwe Friedrichsen - CRDT und mehr - über extreme Verfügbarkeit und selbstheile...
Uwe Friedrichsen - CRDT und mehr - über extreme Verfügbarkeit und selbstheile...Uwe Friedrichsen - CRDT und mehr - über extreme Verfügbarkeit und selbstheile...
Uwe Friedrichsen - CRDT und mehr - über extreme Verfügbarkeit und selbstheile...
 
Kai Voigt - Big Data zum Anfassen - code.talks 2015
Kai Voigt - Big Data zum Anfassen - code.talks 2015Kai Voigt - Big Data zum Anfassen - code.talks 2015
Kai Voigt - Big Data zum Anfassen - code.talks 2015
 
Dr. Andreas Lattner - Aufsetzen skalierbarer Prognose- und Analysedienste mit...
Dr. Andreas Lattner - Aufsetzen skalierbarer Prognose- und Analysedienste mit...Dr. Andreas Lattner - Aufsetzen skalierbarer Prognose- und Analysedienste mit...
Dr. Andreas Lattner - Aufsetzen skalierbarer Prognose- und Analysedienste mit...
 
Marcel Hild - Spryker (e)commerce framework als Alternative zu traditioneller...
Marcel Hild - Spryker (e)commerce framework als Alternative zu traditioneller...Marcel Hild - Spryker (e)commerce framework als Alternative zu traditioneller...
Marcel Hild - Spryker (e)commerce framework als Alternative zu traditioneller...
 
Wolfram Kriesing - EcmaScript6 for real - code.talks 2015
Wolfram Kriesing - EcmaScript6 for real - code.talks 2015Wolfram Kriesing - EcmaScript6 for real - code.talks 2015
Wolfram Kriesing - EcmaScript6 for real - code.talks 2015
 
Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
 Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c... Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
 
Alex Korotkikh - From 0 to N: Lessons Learned - code.talks 2015
 Alex Korotkikh - From 0 to N: Lessons Learned - code.talks 2015 Alex Korotkikh - From 0 to N: Lessons Learned - code.talks 2015
Alex Korotkikh - From 0 to N: Lessons Learned - code.talks 2015
 
Christian Haider & Helge Nowak - Mehr Demokratie durch Haushaltstransparenz ...
 Christian Haider & Helge Nowak - Mehr Demokratie durch Haushaltstransparenz ... Christian Haider & Helge Nowak - Mehr Demokratie durch Haushaltstransparenz ...
Christian Haider & Helge Nowak - Mehr Demokratie durch Haushaltstransparenz ...
 
Bernhard Wick - appserver.io - code.talks 2015
 Bernhard Wick - appserver.io - code.talks 2015 Bernhard Wick - appserver.io - code.talks 2015
Bernhard Wick - appserver.io - code.talks 2015
 
Moritz Siuts & Robert von Massow - Data Pipeline mit Apache Kafka - code.tal...
 Moritz Siuts & Robert von Massow - Data Pipeline mit Apache Kafka - code.tal... Moritz Siuts & Robert von Massow - Data Pipeline mit Apache Kafka - code.tal...
Moritz Siuts & Robert von Massow - Data Pipeline mit Apache Kafka - code.tal...
 

Recently uploaded

guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 

Recently uploaded (20)

guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 

Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.talks 2015

  • 1. boilerplate to high performance scalable APIs gRPC Robert Kubis Developer Advocate
  • 2. 2@hostirosti @grpcio Robert Kubis Developer Advocate Google Cloud Platform London, UK hostirosti github.com/hostirosti About me
  • 5. 5@hostirosti @grpcio A B C D Decomposing Monolithic apps
  • 9. 9@hostirosti @grpcio Today statistics show that there are on average: 12 distinct hosts per page 78 distinct requests per page 1,232 KB transferred per page Resulting in typical render times of 2.6-5.6 seconds (50th and 90th percentiles). So what’s up with HTTP/1? * Numbers are medians, based on latest HTTP Archive crawl data.
  • 10. 10@hostirosti @grpcio HTTP Pipelining Queue responses not requests Domain Sharding Need more than 6 connections per origin? Add more origins! Concatenation and Spriting Multiple JavaScript/CSS/Image files combined into a single resource Resource Inlining Inline JS/CSS/Images in the page img1.example.com img2.example.com img3.example.com ... Coping Strategies
  • 11. 11@hostirosti @grpcio HTTP Pipelining Head of Line blocking Domain Sharding Over sharding can kill performance Concatenation and Spriting Increased complexity, can hurt cache performance and page load Resource Inlining Can hurt cache performance, hard to get granularity right img1.example.com img2.example.com img3.example.com ... Copying Strategies - The downsides
  • 12. 12 ● Improve end-user perceived latency ● Address the "head of line blocking" ● Not require multiple connections ● Retain the semantics of HTTP/1.1 Ilya Grigorik - hpbn.co/http2 - High Performance Browser Networking "HTTP/2 is a protocol designed for low- latency transport of content over the World Wide Web"
  • 13. 13@hostirosti @grpcio One TCP connection Request → Stream Streams are multiplexed Streams are prioritized Binary framing layer Prioritization Flow control Server push Header compression HTTP/2 in one slide ...
  • 14. 14 “... we’re not replacing all of HTTP — the methods, status codes, and most of the headers you use today will be the same. Instead, we’re redefining how it gets used “on the wire” so it’s more efficient, and so that it is more gentle to the Internet itself ....” - Mark Nottingham (HTTPbis chair)
  • 15. 15@hostirosti @grpcio Sits between Socket interface and the API HTTP messages are decomposed into one or more frames HEADERS for meta-data DATA for payload RST_STREAM to cancel … Each frame has a common header 9-byte, length prefixed Easy and efficient to parse HTTP/2 binary framing 101
  • 16. 16@hostirosti @grpcio Basic data flow in HTTP 2.0...
  • 17. 17@hostirosti @grpcio Streams are multiplexed, because frames can be interleaved All frames (e.g. HEADERS, DATA, etc) are sent over single TCP connection Frame delivery is prioritized based on stream dependencies and weights DATA frames are subject to per-stream and connection flow control Basic data flow in HTTP 2.0...
  • 18. 18@hostirosti @grpcio Each stream can have a weight [1-256] integer value Each stream can have a dependency parent is another stream ID 1. E.g.. style.css (“A”) should get 2/3rd’s of available resources as compared to logo.jpg (“B”) 2. E.g.. product-photo-1.jpg (“D”) should be delivered before product-photo-2.jpg (“C”) NOTE: Prioritization is an advisory optimization hint to the server Stream prioritization in HTTP/2...
  • 19. 19@hostirosti @grpcio HTTP/2 server: “You asked for /product/123, I know you’ll also need app.js and product- photo-1.jpg, so… I promise to deliver these to you, no need to ask for them. That is, unless you decline or cancel.” GET /product/123 /product/123 /app.js /product-photo-1.jpg ● Server push is optional and can be disabled by the client ● Server push is subject to flow control - e.g. “you can only push 5Kb” ● Pushed resources can be cached and prioritized individually Server push, “because you’ll also need…”
  • 20. 20@hostirosti @grpcio HTTP/2 client: “I want photo.jpg, please send the first 20KB.” HTTP/2 server: “Ok, 20KB… pausing stream until you tell me to send more.” HTTP/2 client: “Send me the rest now.” GET /product-photo.jpg /product-photo.jpg /product-photo.jpg WINDOW_UPDATE ● Flow control allows the client to pause stream delivery, and resume it later ● Flow control is a “credit-based” scheme ○ Sending DATA frames decrements the window ○ WINDOW_UPDATE frames update the window Per-stream flow control
  • 21. 21@hostirosti @grpcio ● Literal values are (optionally) encoded with a static Huffman code ● Previously sent values are (optionally) indexed ○ e.g. “2” in above example expands to “method: GET” HPACK header compression
  • 23. 23@hostirosti @grpcio Structured representation of data Google's lingua franca for data 48k+ Message Types 12k+ Proto files Evolutionary Development Incrementally solved problems, Now used for: RPC Systems Persistent Data Storage What are Protocol Buffers?
  • 24. 24@hostirosti @grpcio Protocol buffers: Efficient and compact binary data representation Clear compatibility rules; can easily be extended over time Generates idiomatic, easy to use classes for many languages Strongly typed; less error prone Why Protocol Buffers?
  • 25. 25@hostirosti @grpcio Protocol Buffers also are: No use as a markup language Not human readable (native format) Only meaningful if you have the message definition Why not?
  • 26. 26@hostirosti @grpcio Uniquely numbered fields Typed Hierarchical Structure Optional and Repeated fields Extensible without breaking backward compatibility message Person { required string name = 1; required int32 id = 2; optional string email = 3; enum PhoneType { MOBILE = 0; HOME = 1; WORK = 2; } message PhoneNumber { required string number = 1; optional PhoneType type = 2 [default = HOME]; } repeated PhoneNumber phone = 4; } Message Format (proto2)
  • 27. 27@hostirosti @grpcio Protocol Buffers language version 3 Specified by syntax = “proto3”; All fields are optional in proto3 No user specified default values No groups (FYI for those that use them) syntax = “proto3”; message Person { string name = 1; int32 id = 2; string email = 3; enum PhoneType { MOBILE = 0; HOME = 1; WORK = 2; } message PhoneNumber { string number = 1; PhoneType type = 2; } repeated PhoneNumber phone = 4; } Message Format (proto3)
  • 28. 28@hostirosti @grpcio Add new fields without breaking backwards- compatibility old implementations ignore the new fields when parsing In proto3 any field can be removed, but don’t renumber existing fields syntax = “proto3”; message Person { string name = 1; int32 id = 2; string email = 3; address addr = 5; message address { string firstLine = 1; string secondLine = 2; string postalCode = 3; string country = 4; } ... } Extensible
  • 31. 31@hostirosti @grpcio gRPC goals Build an open source, standards-based, best-of-breed, feature-rich RPC system Enable developers to build microservice-based applications Build an open source, standards-based, best-of-breed, feature-rich RPC system Create easy-to-use, efficient and idiomatic libraries micro-servicesperformant and scalableefficient and idiomatic Provide a performant and scalable RPC framework
  • 32. 32@hostirosti @grpcio IDL to describe the API Automatically generated servers and clients in 10+ languages Takes advantage of feature set of HTTP/2 Lightweight open connections Point to point Streaming! Bidirectional streaming! gRPC in a nutshell
  • 34. 34@hostirosti @grpcio Define a service in a .proto file using Protocol Buffers IDL Generate server and client code using the protocol buffer compiler with grpc plugin Use the gRPC API to write a simple client and server for your service in the languages of your choice Getting Started
  • 35. 35@hostirosti @grpcio The most common use-case is a unary request-response RPC Msg1 MsgA Client Server RPC Messages
  • 36. 36@hostirosti @grpcio service RouteGuide { rpc GetFeature(Point) returns (Feature); } message Point { int32 latitude = 1; int32 longitude = 2; } message Feature { string name = 1; Point location = 2; } Service Definition
  • 37. 37@hostirosti @grpcio Msg1Msg2Msg3 MsgA MsgB Metadata Metadata Metadata Client Server The second most common use-case is sending multiple request or response messages in the context of a single RPC call Ordered Bidirectional Streaming RPC
  • 38. 38@hostirosti @grpcio service RouteGuide { rpc ListFeatures (Rectangle) returns (stream Features); ... } message Rectangle { Point lo = 1; Point hi = 2; } Server Streaming RPC Definition
  • 39. 39@hostirosti @grpcio service RouteGuide { rpc RecordRoute (stream Point) returns (RouteSummary); ... } message RouteSummary { int32 point_count = 1; int32 feature_count = 2; int32 distance = 3; int32 elapsed_time = 4; } Client Streaming RPC Definition
  • 40. 40@hostirosti @grpcio service RouteGuide { rpc RouteChat (stream RouteNote) returns (stream RouteNote); ... } message RouteNote { string location = 1; string message = 2; } Bidirectional Streaming RPC Definition
  • 41. 41@hostirosti @grpcio Implementations ● C core ○ Native bindings in C++, Node.js, Python, Ruby, ObjC, PHP, C# ● Java using Netty or OkHttp (+ inProcess for testing) ● Go gRPC Language Support
  • 42. 42@hostirosti @grpcio SSL/TLS gRPC has SSL/TLS integration and promotes the use of SSL/TLS to authenticate the server, and encrypt all the data exchanged between the client and the server. Optional mechanisms are available for clients to provide certificates to accomplish mutual authentication. OAuth 2.0 gRPC provides a generic mechanism to attach metadata to requests and responses. Can be used to attach OAuth 2.0 Access Tokens to RPCs being made at a client. Authentication
  • 43. 43@hostirosti @grpcio Multi-language Freedom to pick the language independently for each micro-service, based on performance, library availability, team expertise etc Loosely coupled development Blocks of functionality can be broken off into separate MicroService. Allows organic growth High Performance Make use of the strengths of HTTP/2 and Protocol Buffers MicroServices using gRPC
  • 44. 44@hostirosti @grpcio C++ Service gRPC server Golang Service gRPC server gRPC Stub Java Service gRPC Stub Python Service gRPC server gRPC Stub Polyglot Microservices Architecture
  • 47. 47@hostirosti @grpcio Photo-sharing App Mobile Clients communicate with gRPC endpoint Clients for iOS and Android https://cloud.google.com/solutions/mobile/image-management-mobile-apps-grpc Abelana Mobile Sample App
  • 50. 50@hostirosti @grpcio grpc is Open Source We want your help! http://grpc.io/contribute https://github.com/grpc irc.freenode.net #grpc @grpcio grpc-io@googlegroups.com
  • 51. 51 @hostirosti @grpcio @googlecloud Thank you! Danke und auf Wiedersehen :)