SlideShare a Scribd company logo
1 of 22
Download to read offline
Building Language
Agnostic APIs with gRPC
Java Day İstanbul
6 May 2017
Mustafa Akın
A high performance, open-source universal
RPC framework
www.grpc.io
Quick Back Story
• Google has been using its own RPC framework
Stubby to communicate millions of micro-services
for over a decade. 10^10 RPC calls per second.
• A uniform and cross-platform RPC allowed
efficiency and quick deployment and development.
• However Stubby was tied to Google internals,
therefore they rebuilt it with newer technologies
such as HTTP/2 to extend its usage, and open
source gRPC was born
Web Services in 2007
Web Services in 2017
Why would you want to use
gRPC?
• Quickly build APIs and avoid writing request/response parser
codes
• Use the language you desire interchangeably for client-server
roles
• Avoid on-the-fly parsing by imposing a pre-established schema
and have low latency and highly scalable system
• Use bi-directional streaming instead of classical request-
response APIs
• Use HTTP/2.0 for having millions of streams over a single-
connection
How does gRPC Work?
• You define your service in Protocol Buffers format.
• From a .proto file, server-side and client-side code
are generated for your favourite languages
• You extend the generated code and implement the
required interfaces only and start listening on a port
• In same or another language, you can use the
generated client code to connect to your server,
avoiding writing any boilerplate code.
In short, gRPC allows you to define your
service, generate boilerplate codes for you and
you only have to write your business logic.
You can decide on the service definition initially, and let
client and server to be developed independently. You can
also easily upgrade your service definitions with gRPC.
Protocol Buffers
• IDL: Interface Definition Language
• Data Model: Request and Response are Structured
• Wire Format: Binary, because computers do not
need human-readable!
Protocol Buffers vs JSON
Binary Encoded Text Encoded
Decoding requiredRapidly parseable
Example gRPC Proto
Java Client Code
Java Server Code
Python Client Code
Python Server Code
Go Client Code
Go Server Code
Ruby Client Code
Ruby Server Code
Streaming Services in gRPC
• Simple RPC: Request and response
• Server-side streaming RPC: Client makes a request and
then server sends many responses over time until there
are no more.
• Client-side streaming RPC: Client makes many requests
over time, server reads them and sends a single response
at the end.
• Bi-directional streaming RPC: Both client and server
sends each other messages over time and both streams
can be independent.
Language support in gRPC
• C++
• Java
• Python
• Go
• Ruby
• Android
• NodeJS
• Objective-C
• PHP
Principles of gRPC
• Services not Objects, Messages not References
• Coverage & Simplicity
• Free & Open
• Interoperability & Reach
• General Purpose & Performant
• Layered
Principles of gRPC
• Payload Agnostic
• Streaming
• Blocking & Non-Blocking
• Cancellation & Timeout
• General Purpose & Performant
• Lameducking
Principles of gRPC
• Flow-Control
• Pluggable
• Extensions as APIs
• Metadata Exchange
• Standardized Status Codes
Who uses gRPC?
• Square
• Docker
• Kubernetes
• Coreos
• Cisco
• Juniper Networks
• Netflix
You can contact me by e-mail at:
mustafa91@gmail.com
twitter: @mustafaakin
Any questions?
Thank you for listening.

More Related Content

What's hot

Introduction to gRPC
Introduction to gRPCIntroduction to gRPC
Introduction to gRPCPrakash Divy
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecturejuly mon
 
Event-Driven Microservices With NATS Streaming
Event-Driven Microservices With NATS StreamingEvent-Driven Microservices With NATS Streaming
Event-Driven Microservices With NATS StreamingShiju Varghese
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideTim Burks
 
Performance is not an Option - gRPC and Cassandra
Performance is not an Option - gRPC and CassandraPerformance is not an Option - gRPC and Cassandra
Performance is not an Option - gRPC and CassandraDave Bechberger
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftRX-M Enterprises LLC
 
What we learnt at carousell tw for golang gathering #31
What we learnt at carousell tw for golang gathering #31What we learnt at carousell tw for golang gathering #31
What we learnt at carousell tw for golang gathering #31Ronald Hsu
 
Writing HTTP Middleware In Go
Writing HTTP Middleware In GoWriting HTTP Middleware In Go
Writing HTTP Middleware In GoShiju Varghese
 
Monolithic to microservices
Monolithic to microservicesMonolithic to microservices
Monolithic to microservicesRonald Hsu
 
202104 technical challenging and our solutions - golang taipei
202104   technical challenging and our solutions - golang taipei202104   technical challenging and our solutions - golang taipei
202104 technical challenging and our solutions - golang taipeiRonald Hsu
 
Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®confluent
 
WebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceWebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceRick Hightower
 
Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATSApcera
 
Introducing the Microservices Reference Architecture Version 1.2
Introducing the Microservices Reference Architecture Version 1.2Introducing the Microservices Reference Architecture Version 1.2
Introducing the Microservices Reference Architecture Version 1.2NGINX, Inc.
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API GatewayYohann Ciurlik
 
Hello Lambda - How to call Lambdas on AWS
Hello Lambda - How to call Lambdas on AWSHello Lambda - How to call Lambdas on AWS
Hello Lambda - How to call Lambdas on AWSDavid Roberts
 
NATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATSNATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATSRaül Pérez
 
Kuberntes Ingress with Kong
Kuberntes Ingress with KongKuberntes Ingress with Kong
Kuberntes Ingress with KongNebulaworks
 

What's hot (20)

gRPC
gRPCgRPC
gRPC
 
Introduction to gRPC
Introduction to gRPCIntroduction to gRPC
Introduction to gRPC
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
 
Event-Driven Microservices With NATS Streaming
Event-Driven Microservices With NATS StreamingEvent-Driven Microservices With NATS Streaming
Event-Driven Microservices With NATS Streaming
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-Side
 
Performance is not an Option - gRPC and Cassandra
Performance is not an Option - gRPC and CassandraPerformance is not an Option - gRPC and Cassandra
Performance is not an Option - gRPC and Cassandra
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
 
What we learnt at carousell tw for golang gathering #31
What we learnt at carousell tw for golang gathering #31What we learnt at carousell tw for golang gathering #31
What we learnt at carousell tw for golang gathering #31
 
Writing HTTP Middleware In Go
Writing HTTP Middleware In GoWriting HTTP Middleware In Go
Writing HTTP Middleware In Go
 
Monolithic to microservices
Monolithic to microservicesMonolithic to microservices
Monolithic to microservices
 
202104 technical challenging and our solutions - golang taipei
202104   technical challenging and our solutions - golang taipei202104   technical challenging and our solutions - golang taipei
202104 technical challenging and our solutions - golang taipei
 
Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®Tips & Tricks for Apache Kafka®
Tips & Tricks for Apache Kafka®
 
WebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceWebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST Microservice
 
Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS
 
Introducing the Microservices Reference Architecture Version 1.2
Introducing the Microservices Reference Architecture Version 1.2Introducing the Microservices Reference Architecture Version 1.2
Introducing the Microservices Reference Architecture Version 1.2
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API Gateway
 
Hello Lambda - How to call Lambdas on AWS
Hello Lambda - How to call Lambdas on AWSHello Lambda - How to call Lambdas on AWS
Hello Lambda - How to call Lambdas on AWS
 
NATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATSNATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATS
 
Kuberntes Ingress with Kong
Kuberntes Ingress with KongKuberntes Ingress with Kong
Kuberntes Ingress with Kong
 
Kong API
Kong APIKong API
Kong API
 

Similar to Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017

Rpc framework
Rpc frameworkRpc framework
Rpc frameworkjuly mon
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC! REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC! QAware GmbH
 
Microservices summit talk 1/31
Microservices summit talk   1/31Microservices summit talk   1/31
Microservices summit talk 1/31Varun Talwar
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservicesRon Barabash
 
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 stackLuca Mattia Ferrari
 
INTERFACE by apidays_What's your Type? Understanding API Types and Choosing t...
INTERFACE by apidays_What's your Type? Understanding API Types and Choosing t...INTERFACE by apidays_What's your Type? Understanding API Types and Choosing t...
INTERFACE by apidays_What's your Type? Understanding API Types and Choosing t...apidays
 
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...apidays
 
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, GoogleAmbassador Labs
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!QAware GmbH
 
APIs Design - Creation - Management.pdf
APIs Design - Creation - Management.pdfAPIs Design - Creation - Management.pdf
APIs Design - Creation - Management.pdfWilliamELKAIMPhd
 
Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Tony Tam
 
gRPC Design and Implementation
gRPC Design and ImplementationgRPC Design and Implementation
gRPC Design and ImplementationVarun Talwar
 
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...Tien Nguyen
 
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...VMware Tanzu
 
Design and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice ArchitectureDesign and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice ArchitectureLohika_Odessa_TechTalks
 

Similar to Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017 (20)

Rpc framework
Rpc frameworkRpc framework
Rpc framework
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC! REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
Cloud Native API Design and Management
Cloud Native API Design and ManagementCloud Native API Design and Management
Cloud Native API Design and Management
 
Microservices summit talk 1/31
Microservices summit talk   1/31Microservices summit talk   1/31
Microservices summit talk 1/31
 
GRPC.pptx
GRPC.pptxGRPC.pptx
GRPC.pptx
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservices
 
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
 
gRPC services testing
gRPC services testinggRPC services testing
gRPC services testing
 
INTERFACE by apidays_What's your Type? Understanding API Types and Choosing t...
INTERFACE by apidays_What's your Type? Understanding API Types and Choosing t...INTERFACE by apidays_What's your Type? Understanding API Types and Choosing t...
INTERFACE by apidays_What's your Type? Understanding API Types and Choosing t...
 
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
 
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
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
APIs Design - Creation - Management.pdf
APIs Design - Creation - Management.pdfAPIs Design - Creation - Management.pdf
APIs Design - Creation - Management.pdf
 
Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)
 
gRPC Design and Implementation
gRPC Design and ImplementationgRPC Design and Implementation
gRPC Design and Implementation
 
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...
 
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
 
Introduction to gRPC
Introduction to gRPCIntroduction to gRPC
Introduction to gRPC
 
6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF
 
Design and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice ArchitectureDesign and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice Architecture
 

Recently uploaded

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 

Recently uploaded (20)

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 

Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017

  • 1. Building Language Agnostic APIs with gRPC Java Day İstanbul 6 May 2017 Mustafa Akın
  • 2. A high performance, open-source universal RPC framework www.grpc.io
  • 3. Quick Back Story • Google has been using its own RPC framework Stubby to communicate millions of micro-services for over a decade. 10^10 RPC calls per second. • A uniform and cross-platform RPC allowed efficiency and quick deployment and development. • However Stubby was tied to Google internals, therefore they rebuilt it with newer technologies such as HTTP/2 to extend its usage, and open source gRPC was born
  • 6. Why would you want to use gRPC? • Quickly build APIs and avoid writing request/response parser codes • Use the language you desire interchangeably for client-server roles • Avoid on-the-fly parsing by imposing a pre-established schema and have low latency and highly scalable system • Use bi-directional streaming instead of classical request- response APIs • Use HTTP/2.0 for having millions of streams over a single- connection
  • 7. How does gRPC Work? • You define your service in Protocol Buffers format. • From a .proto file, server-side and client-side code are generated for your favourite languages • You extend the generated code and implement the required interfaces only and start listening on a port • In same or another language, you can use the generated client code to connect to your server, avoiding writing any boilerplate code.
  • 8. In short, gRPC allows you to define your service, generate boilerplate codes for you and you only have to write your business logic. You can decide on the service definition initially, and let client and server to be developed independently. You can also easily upgrade your service definitions with gRPC.
  • 9. Protocol Buffers • IDL: Interface Definition Language • Data Model: Request and Response are Structured • Wire Format: Binary, because computers do not need human-readable!
  • 10. Protocol Buffers vs JSON Binary Encoded Text Encoded Decoding requiredRapidly parseable
  • 12. Java Client Code Java Server Code
  • 14. Go Client Code Go Server Code
  • 15. Ruby Client Code Ruby Server Code
  • 16. Streaming Services in gRPC • Simple RPC: Request and response • Server-side streaming RPC: Client makes a request and then server sends many responses over time until there are no more. • Client-side streaming RPC: Client makes many requests over time, server reads them and sends a single response at the end. • Bi-directional streaming RPC: Both client and server sends each other messages over time and both streams can be independent.
  • 17. Language support in gRPC • C++ • Java • Python • Go • Ruby • Android • NodeJS • Objective-C • PHP
  • 18. Principles of gRPC • Services not Objects, Messages not References • Coverage & Simplicity • Free & Open • Interoperability & Reach • General Purpose & Performant • Layered
  • 19. Principles of gRPC • Payload Agnostic • Streaming • Blocking & Non-Blocking • Cancellation & Timeout • General Purpose & Performant • Lameducking
  • 20. Principles of gRPC • Flow-Control • Pluggable • Extensions as APIs • Metadata Exchange • Standardized Status Codes
  • 21. Who uses gRPC? • Square • Docker • Kubernetes • Coreos • Cisco • Juniper Networks • Netflix
  • 22. You can contact me by e-mail at: mustafa91@gmail.com twitter: @mustafaakin Any questions? Thank you for listening.