SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
gRPC: Beyond REST
history repeats itself infinitely
About me
• JVM developer since 1998
• Cofounder @ CirculoSiete
• Staff @ JVM Mexico City
• @domix
History
• Lupine. Powered Courier by XEROX (1981)
• Bruce Jay Nelson coined the term ‘RPC’
• SUN’s RPC (ONC RPC) ~NFS
• CORBA (1991)
• RMI
• Burlap/Hessian
gRPC?
• Stands for ‘gRPC Remote Procedure Call’
• Open source project from Google hosted by the Cloud Native Computing
Foundation
• High Performance, general purpose standard base, RPC framework.
• Open sourced of ‘Stubby RPC’ at Google
Why gRPC?
• We already have REST|GraphQL, why?
• Maybe performance?
• https://goo.gl/yM7XPM
• https://goo.gl/oYY8dr
• https://goo.gl/TtzXad
• Contract first approach
• Multi platform
Performance
• HTTP/2
• Single TCP connection
• Binary framing layer
• Header compression
• Persistent connections
• http://www.http2demo.io
Contract first approach
Protocol Buffers
• Protocol buffers are a flexible, efficient, automated
mechanism for serializing structured data, smaller, faster,
and simpler than XML or JSON.
• You can update your data structure without breaking
deployed programs.
• Language/platform agnostic.
• You have to write a definition in a text file ‘.proto’.
• A compiler is needed to generate the desired source code.
syntax = "proto3";
package com.circulosiete.cursos.k8s;
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
option java_multiple_files = true;
option go_package = "warehouse";
message PageProductResponse {
google.protobuf.BoolValue first = 1; //unique numbered tag: 1
google.protobuf.BoolValue last = 2; //unique numbered tag: 2
google.protobuf.Int32Value number = 3; //unique numbered tag: 3
google.protobuf.Int32Value numberOfElements = 4; //unique numbered tag: 4
google.protobuf.Int32Value size = 5; //unique numbered tag: 5
google.protobuf.Int64Value totalElements = 6; //unique numbered tag: 6
google.protobuf.Int32Value totalPages = 7; //unique numbered tag: 7
repeated ProductModel content = 8;
}
message ProductModel {
int64 id = 1;
string name = 2;
string description = 3;
string price = 4;
google.protobuf.Timestamp createdAt = 5;
google.protobuf.Timestamp modifiedDate = 6;
int64 version = 7;
}
Contract!
service ProductService {
rpc Create (ProductRequest) returns (ProductResponse);
rpc Read (EntityId) returns (ProductResponse);
rpc Update (ProductModel) returns (ProductResponse);
rpc Delete (EntityId) returns (ProductResponse);
rpc Paged (Page) returns (PageProductResponse);
rpc List (Page) returns (stream ProductResponse);
}
service ValidacionService {
rpc ValidacionCreate (CreateRequest) returns (ValidacionResponse);
rpc ValidacionDelete (EntityId) returns (ValidacionResponse);
}
Multiplatform
gRPC compiler
• Takes proto files then generates specific source files
• It supports several plugins, for different programming languages
• It generates Server files, client files.
JVM
• Netty Powered!
• Gradle and Maven support
• Spring Boot community support
Live Coding!
gRPC intro demo
What about REST?
REST and gRPC
• REST is still necessary
• JavaScript applications
• Web Browser
• We can reuse our gRPC endpoints in REST
• https://github.com/grpc-ecosystem/grpc-gateway
gRPC gateway
• For now only supports Go Lang
• We have to use some Google Annotations
• The good
• Fast as hell!
• The Ugly
• Sometimes the Go Lang dev env is difficult to setup
Live Coding!
gRPC complete demo
Contact
• @domix
• domingo.suarez@gmail.com
• http://slideshare.net/domingo.suarez
Photos
• https://unsplash.com/photos/_cb5MjNG3DI
• https://unsplash.com/photos/1qkyck-UL3g
• https://unsplash.com/photos/w7ZyuGYNpRQ
• https://unsplash.com/photos/YucYLQ6Dm8A

Más contenido relacionado

La actualidad más candente

How happy they became with H2O/mruby and the future of HTTP
How happy they became with H2O/mruby and the future of HTTPHow happy they became with H2O/mruby and the future of HTTP
How happy they became with H2O/mruby and the future of HTTP
Ichito Nagata
 

La actualidad más candente (20)

"Enabling Googley microservices with gRPC" at JDK.IO 2017
"Enabling Googley microservices with gRPC" at JDK.IO 2017"Enabling Googley microservices with gRPC" at JDK.IO 2017
"Enabling Googley microservices with gRPC" at JDK.IO 2017
 
gRPC
gRPCgRPC
gRPC
 
Power-up services with gRPC
Power-up services with gRPCPower-up services with gRPC
Power-up services with gRPC
 
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 microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
 
gRPC in Go
gRPC in GogRPC in Go
gRPC in Go
 
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.
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
 
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
 
gRPC Overview
gRPC OverviewgRPC Overview
gRPC Overview
 
gRPC Design and Implementation
gRPC Design and ImplementationgRPC Design and Implementation
gRPC Design and Implementation
 
gRPC
gRPCgRPC
gRPC
 
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
 
G rpc talk with intel (3)
G rpc talk with intel (3)G rpc talk with intel (3)
G rpc talk with intel (3)
 
"Enabling Googley microservices with gRPC." at Devoxx France 2017
"Enabling Googley microservices with gRPC." at Devoxx France 2017"Enabling Googley microservices with gRPC." at Devoxx France 2017
"Enabling Googley microservices with gRPC." at Devoxx France 2017
 
Make gRPC great again
Make gRPC great againMake gRPC great again
Make gRPC great again
 
Максим Барышиков-«WoT: Geographically distributed cluster of clusters»
Максим Барышиков-«WoT: Geographically distributed cluster of clusters»Максим Барышиков-«WoT: Geographically distributed cluster of clusters»
Максим Барышиков-«WoT: Geographically distributed cluster of clusters»
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
 
How happy they became with H2O/mruby and the future of HTTP
How happy they became with H2O/mruby and the future of HTTPHow happy they became with H2O/mruby and the future of HTTP
How happy they became with H2O/mruby and the future of HTTP
 
"Enabling Googley microservices with gRPC" at JEEConf 2017
"Enabling Googley microservices with gRPC" at JEEConf 2017"Enabling Googley microservices with gRPC" at JEEConf 2017
"Enabling Googley microservices with gRPC" at JEEConf 2017
 

Similar a gRPC: Beyond REST

Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
nohuhu
 
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
goccy
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
Nobuo Danjou
 
MongoDB at Gilt Groupe
MongoDB at Gilt GroupeMongoDB at Gilt Groupe
MongoDB at Gilt Groupe
MongoDB
 

Similar a gRPC: Beyond REST (20)

apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
 
Intro to CakePHP
Intro to CakePHPIntro to CakePHP
Intro to CakePHP
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
 
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQ
 
A brief to PHP 7.3
A brief to PHP 7.3A brief to PHP 7.3
A brief to PHP 7.3
 
Android: a full-stack to consume a REST API
Android: a full-stack to consume a REST APIAndroid: a full-stack to consume a REST API
Android: a full-stack to consume a REST API
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
 
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd についてKubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
 
202107 - Orion introduction - COSCUP
202107 - Orion introduction - COSCUP202107 - Orion introduction - COSCUP
202107 - Orion introduction - COSCUP
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
 
マイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPCマイクロサービスバックエンドAPIのためのRESTとgRPC
マイクロサービスバックエンドAPIのためのRESTとgRPC
 
Containerd Project Update: FOSDEM 2018
Containerd Project Update: FOSDEM 2018Containerd Project Update: FOSDEM 2018
Containerd Project Update: FOSDEM 2018
 
PHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLitePHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLite
 
The State of containerd
The State of containerdThe State of containerd
The State of containerd
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
 
MongoDB at Gilt Groupe
MongoDB at Gilt GroupeMongoDB at Gilt Groupe
MongoDB at Gilt Groupe
 
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP Perspective
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with Go
 
From Java to Python
From Java to PythonFrom Java to Python
From Java to Python
 

Más de Domingo Suarez Torres

Más de Domingo Suarez Torres (20)

Cloud Native MX Meetup - Asegurando tu Cluster de Kubernetes
Cloud Native MX Meetup - Asegurando tu Cluster de KubernetesCloud Native MX Meetup - Asegurando tu Cluster de Kubernetes
Cloud Native MX Meetup - Asegurando tu Cluster de Kubernetes
 
Java Dev Day 2019 No kuberneteen por convivir
Java Dev Day 2019  No kuberneteen por convivirJava Dev Day 2019  No kuberneteen por convivir
Java Dev Day 2019 No kuberneteen por convivir
 
Contenedores 101 Digital Ocean CDMX
Contenedores 101 Digital Ocean CDMXContenedores 101 Digital Ocean CDMX
Contenedores 101 Digital Ocean CDMX
 
Retos en la arquitectura de Microservicios
Retos en la arquitectura de MicroserviciosRetos en la arquitectura de Microservicios
Retos en la arquitectura de Microservicios
 
Java Cloud Native Hack Nights GDL
Java Cloud Native Hack Nights GDLJava Cloud Native Hack Nights GDL
Java Cloud Native Hack Nights GDL
 
meetup digital ocean kubernetes
meetup digital ocean kubernetesmeetup digital ocean kubernetes
meetup digital ocean kubernetes
 
Peru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVMPeru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVM
 
DevFest Lima Corriendo cargas e trabajo seguras en GKE con Istio
DevFest Lima Corriendo cargas e trabajo seguras en GKE con IstioDevFest Lima Corriendo cargas e trabajo seguras en GKE con Istio
DevFest Lima Corriendo cargas e trabajo seguras en GKE con Istio
 
Cloud Native Development in the JVM
Cloud Native Development in the JVMCloud Native Development in the JVM
Cloud Native Development in the JVM
 
Cloud Native Mexico - Introducción a Kubernetes
Cloud Native Mexico - Introducción a KubernetesCloud Native Mexico - Introducción a Kubernetes
Cloud Native Mexico - Introducción a Kubernetes
 
Meetup DigitalOcean Cloud Native architecture
Meetup DigitalOcean Cloud Native architectureMeetup DigitalOcean Cloud Native architecture
Meetup DigitalOcean Cloud Native architecture
 
Cloud Native Mexico Meetup de Marzo 2018 Service Mesh con Istio y Envoy
Cloud Native Mexico Meetup de Marzo 2018 Service Mesh con Istio y EnvoyCloud Native Mexico Meetup de Marzo 2018 Service Mesh con Istio y Envoy
Cloud Native Mexico Meetup de Marzo 2018 Service Mesh con Istio y Envoy
 
Cloud Native Mexico Meetup enero 2018 Observability
Cloud Native Mexico Meetup enero 2018 ObservabilityCloud Native Mexico Meetup enero 2018 Observability
Cloud Native Mexico Meetup enero 2018 Observability
 
Cloud Native Mexico Presentacion
Cloud Native Mexico PresentacionCloud Native Mexico Presentacion
Cloud Native Mexico Presentacion
 
Devops Landscape
Devops LandscapeDevops Landscape
Devops Landscape
 
Orquestación de contenedores con Kubernetes SGNext
Orquestación de contenedores con Kubernetes SGNextOrquestación de contenedores con Kubernetes SGNext
Orquestación de contenedores con Kubernetes SGNext
 
JVM Reactive Programming
JVM Reactive ProgrammingJVM Reactive Programming
JVM Reactive Programming
 
SGNext Elasticsearch
SGNext ElasticsearchSGNext Elasticsearch
SGNext Elasticsearch
 
Webinar Arquitectura de Microservicios
Webinar Arquitectura de MicroserviciosWebinar Arquitectura de Microservicios
Webinar Arquitectura de Microservicios
 
Elasticsearch JVM-MX Meetup April 2016
Elasticsearch JVM-MX Meetup April 2016Elasticsearch JVM-MX Meetup April 2016
Elasticsearch JVM-MX Meetup April 2016
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

gRPC: Beyond REST

  • 1. gRPC: Beyond REST history repeats itself infinitely
  • 2. About me • JVM developer since 1998 • Cofounder @ CirculoSiete • Staff @ JVM Mexico City • @domix
  • 3. History • Lupine. Powered Courier by XEROX (1981) • Bruce Jay Nelson coined the term ‘RPC’ • SUN’s RPC (ONC RPC) ~NFS • CORBA (1991) • RMI • Burlap/Hessian
  • 4. gRPC? • Stands for ‘gRPC Remote Procedure Call’ • Open source project from Google hosted by the Cloud Native Computing Foundation • High Performance, general purpose standard base, RPC framework. • Open sourced of ‘Stubby RPC’ at Google
  • 5. Why gRPC? • We already have REST|GraphQL, why? • Maybe performance? • https://goo.gl/yM7XPM • https://goo.gl/oYY8dr • https://goo.gl/TtzXad • Contract first approach • Multi platform
  • 6. Performance • HTTP/2 • Single TCP connection • Binary framing layer • Header compression • Persistent connections • http://www.http2demo.io
  • 8. Protocol Buffers • Protocol buffers are a flexible, efficient, automated mechanism for serializing structured data, smaller, faster, and simpler than XML or JSON. • You can update your data structure without breaking deployed programs. • Language/platform agnostic. • You have to write a definition in a text file ‘.proto’. • A compiler is needed to generate the desired source code.
  • 9. syntax = "proto3"; package com.circulosiete.cursos.k8s; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "google/api/annotations.proto"; option java_multiple_files = true; option go_package = "warehouse"; message PageProductResponse { google.protobuf.BoolValue first = 1; //unique numbered tag: 1 google.protobuf.BoolValue last = 2; //unique numbered tag: 2 google.protobuf.Int32Value number = 3; //unique numbered tag: 3 google.protobuf.Int32Value numberOfElements = 4; //unique numbered tag: 4 google.protobuf.Int32Value size = 5; //unique numbered tag: 5 google.protobuf.Int64Value totalElements = 6; //unique numbered tag: 6 google.protobuf.Int32Value totalPages = 7; //unique numbered tag: 7 repeated ProductModel content = 8; } message ProductModel { int64 id = 1; string name = 2; string description = 3; string price = 4; google.protobuf.Timestamp createdAt = 5; google.protobuf.Timestamp modifiedDate = 6; int64 version = 7; }
  • 10. Contract! service ProductService { rpc Create (ProductRequest) returns (ProductResponse); rpc Read (EntityId) returns (ProductResponse); rpc Update (ProductModel) returns (ProductResponse); rpc Delete (EntityId) returns (ProductResponse); rpc Paged (Page) returns (PageProductResponse); rpc List (Page) returns (stream ProductResponse); } service ValidacionService { rpc ValidacionCreate (CreateRequest) returns (ValidacionResponse); rpc ValidacionDelete (EntityId) returns (ValidacionResponse); }
  • 12. gRPC compiler • Takes proto files then generates specific source files • It supports several plugins, for different programming languages • It generates Server files, client files.
  • 13. JVM • Netty Powered! • Gradle and Maven support • Spring Boot community support
  • 16. REST and gRPC • REST is still necessary • JavaScript applications • Web Browser • We can reuse our gRPC endpoints in REST • https://github.com/grpc-ecosystem/grpc-gateway
  • 17. gRPC gateway • For now only supports Go Lang • We have to use some Google Annotations • The good • Fast as hell! • The Ugly • Sometimes the Go Lang dev env is difficult to setup
  • 19. Contact • @domix • domingo.suarez@gmail.com • http://slideshare.net/domingo.suarez
  • 20. Photos • https://unsplash.com/photos/_cb5MjNG3DI • https://unsplash.com/photos/1qkyck-UL3g • https://unsplash.com/photos/w7ZyuGYNpRQ • https://unsplash.com/photos/YucYLQ6Dm8A