Building Microservices with
gRPC
Sathya
Software Developer @ MoneySmart
REST APIs
● Well defined HTTP verbs
● JSON objects can be consumed by JavaScript easily.
● cURL friendly.
● Matured HTTP client libraries support in major languages.
Is it suitable for Microservices?
Not everything is a resource
Calculator Service
Manual Stub Code
Other problems
● Maintenance of the API documentation.
● JSON is text based which added unnecessary burden to the performance when serializing and
deserializing data.
gRPC
gRPC
● High performance RPC system.
● Uses HTTP/2 for transport.
● Uses ProtoBuf as Message Format.
● Supports different modes such as unary and bidirectional streaming.
● Ability to Cancel or Timeout requests.
ProtoBuf
● Mechanism for serializing structured data
● Binary Message Format
● For describing both service interface and message
structure
Advantages:
1. Better Performance
2. Easy to read Service and Message Definition
3. Able to generate Stub Classes Programmatically
Benefits of gRPC
1. Proto files itself act as the service documentation.
2. Automatic code generation for stubs by using proto compilers.
3. Better Performance by using HTTP/2 for transport and protobuf for serializing
Writing gRPC service
Steps:
1. Write Service Definition in Proto file format.
2. Generate Client / Server code using proto compiler.
3. Implement the Server by extending the generated server code.
4. Implement the Client by calling methods using the generated Client Stub.
Questions???
Useful Links
● https://grpc.io/
● https://developers.google.com/protocol-buffers/docs/proto3
● https://github.com/bigcommerce/gruf
● http://avi.im/grpc-errors/#ruby
● https://github.com/avinassh/grpc-errors
www.moneysmart.co/jobs

More Related Content

PPTX
REST vs gRPC: Battle of API's
PDF
gRPC and Microservices
PPTX
HTTP2 and gRPC
PPTX
GRPC.pptx
PDF
gRPC Design and Implementation
PDF
gRPC Overview
PPTX
Introduction to gRPC
REST vs gRPC: Battle of API's
gRPC and Microservices
HTTP2 and gRPC
GRPC.pptx
gRPC Design and Implementation
gRPC Overview
Introduction to gRPC

What's hot (20)

PDF
gRPC with java
PDF
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
PDF
Introduction to gRPC
PDF
gRPC in Go
PDF
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
PPTX
Message Broker System and RabbitMQ
PPTX
Jetpack Compose.pptx
PPTX
Introduction to gRPC (Application) Presentation
PDF
Power-up services with gRPC
PDF
Inter-Process Communication in Microservices using gRPC
ODP
Protocol Buffers
PPTX
Building your First gRPC Service
PDF
Building layers of defense for your application
PDF
gRPC: The Story of Microservices at Square
PDF
OpenAPI and gRPC Side by-Side
ODP
BDD with Cucumber
PPTX
Cucumber BDD
PDF
GraphQL: Enabling a new generation of API developer tools
PDF
Introduction to Spring Cloud
gRPC with java
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
Introduction to gRPC
gRPC in Go
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Message Broker System and RabbitMQ
Jetpack Compose.pptx
Introduction to gRPC (Application) Presentation
Power-up services with gRPC
Inter-Process Communication in Microservices using gRPC
Protocol Buffers
Building your First gRPC Service
Building layers of defense for your application
gRPC: The Story of Microservices at Square
OpenAPI and gRPC Side by-Side
BDD with Cucumber
Cucumber BDD
GraphQL: Enabling a new generation of API developer tools
Introduction to Spring Cloud
Ad

Similar to Building microservices with grpc (20)

PPTX
Building API Using GRPC And Scala
PDF
gRPC: Beyond REST
PDF
gRPC Microservices in Go (MEAP V08) Hüseyin Babal
PDF
Garuda: Automagically Exposing Djagno ORM over gRPC for microservices written...
PDF
gRPC or Rest, why not both?
PDF
gRPC services testing
PDF
Implementing OpenAPI and GraphQL services with gRPC
PDF
Build microservice with gRPC in golang
PDF
Build your next REST API with gRPC
PDF
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
PPTX
CocoaConf: The Language of Mobile Software is APIs
PPTX
Introduction to gRPC. Advantages and Disadvantages
PDF
Microservices Communication Patterns with gRPC
PDF
マイクロサービスバックエンドAPIのためのRESTとgRPC
PDF
gRPC - RPC rebirth?
PDF
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
PPTX
Apa itu gRPC_.pptx
PDF
Driving containerd operations with gRPC
PDF
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
PPTX
Grpc present
Building API Using GRPC And Scala
gRPC: Beyond REST
gRPC Microservices in Go (MEAP V08) Hüseyin Babal
Garuda: Automagically Exposing Djagno ORM over gRPC for microservices written...
gRPC or Rest, why not both?
gRPC services testing
Implementing OpenAPI and GraphQL services with gRPC
Build microservice with gRPC in golang
Build your next REST API with gRPC
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
CocoaConf: The Language of Mobile Software is APIs
Introduction to gRPC. Advantages and Disadvantages
Microservices Communication Patterns with gRPC
マイクロサービスバックエンドAPIのためのRESTとgRPC
gRPC - RPC rebirth?
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Apa itu gRPC_.pptx
Driving containerd operations with gRPC
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
Grpc present
Ad

Recently uploaded (20)

PDF
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
PDF
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
PDF
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
PDF
ment.tech-How to Develop an AI Agent Healthcare App like Sully AI (1).pdf
PPTX
Report in SIP_Distance_Learning_Technology_Impact.pptx
PDF
【AI論文解説】高速・高品質な生成を実現するFlow Map Models(Part 1~3)
PDF
Domain-specific knowledge and context in large language models: challenges, c...
PDF
TrustArc Webinar - Data Minimization in Practice_ Reducing Risk, Enhancing Co...
PDF
1_Keynote_Breaking Barriers_한계를 넘어서_Charith Mendis.pdf
PDF
State of AI in Business 2025 - MIT NANDA
PDF
Examining Bias in AI Generated News Content.pdf
PPTX
Introduction-to-Artificial-Intelligence (1).pptx
PDF
Optimizing bioinformatics applications: a novel approach with human protein d...
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PPTX
Presentation - Principles of Instructional Design.pptx
PDF
Secure Java Applications against Quantum Threats
PPTX
Blending method and technology for hydrogen.pptx
PDF
Addressing the challenges of harmonizing law and artificial intelligence tech...
PDF
Peak of Data & AI Encore: Scalable Design & Infrastructure
PDF
Introduction to c language from lecture slides
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
ment.tech-How to Develop an AI Agent Healthcare App like Sully AI (1).pdf
Report in SIP_Distance_Learning_Technology_Impact.pptx
【AI論文解説】高速・高品質な生成を実現するFlow Map Models(Part 1~3)
Domain-specific knowledge and context in large language models: challenges, c...
TrustArc Webinar - Data Minimization in Practice_ Reducing Risk, Enhancing Co...
1_Keynote_Breaking Barriers_한계를 넘어서_Charith Mendis.pdf
State of AI in Business 2025 - MIT NANDA
Examining Bias in AI Generated News Content.pdf
Introduction-to-Artificial-Intelligence (1).pptx
Optimizing bioinformatics applications: a novel approach with human protein d...
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
Presentation - Principles of Instructional Design.pptx
Secure Java Applications against Quantum Threats
Blending method and technology for hydrogen.pptx
Addressing the challenges of harmonizing law and artificial intelligence tech...
Peak of Data & AI Encore: Scalable Design & Infrastructure
Introduction to c language from lecture slides

Building microservices with grpc

  • 2. REST APIs ● Well defined HTTP verbs ● JSON objects can be consumed by JavaScript easily. ● cURL friendly. ● Matured HTTP client libraries support in major languages.
  • 3. Is it suitable for Microservices?
  • 4. Not everything is a resource Calculator Service
  • 6. Other problems ● Maintenance of the API documentation. ● JSON is text based which added unnecessary burden to the performance when serializing and deserializing data.
  • 8. gRPC ● High performance RPC system. ● Uses HTTP/2 for transport. ● Uses ProtoBuf as Message Format. ● Supports different modes such as unary and bidirectional streaming. ● Ability to Cancel or Timeout requests.
  • 9. ProtoBuf ● Mechanism for serializing structured data ● Binary Message Format ● For describing both service interface and message structure Advantages: 1. Better Performance 2. Easy to read Service and Message Definition 3. Able to generate Stub Classes Programmatically
  • 10. Benefits of gRPC 1. Proto files itself act as the service documentation. 2. Automatic code generation for stubs by using proto compilers. 3. Better Performance by using HTTP/2 for transport and protobuf for serializing
  • 11. Writing gRPC service Steps: 1. Write Service Definition in Proto file format. 2. Generate Client / Server code using proto compiler. 3. Implement the Server by extending the generated server code. 4. Implement the Client by calling methods using the generated Client Stub.
  • 13. Useful Links ● https://grpc.io/ ● https://developers.google.com/protocol-buffers/docs/proto3 ● https://github.com/bigcommerce/gruf ● http://avi.im/grpc-errors/#ruby ● https://github.com/avinassh/grpc-errors