Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Inter-Process
Communication in
Microservices using gRPC
Shiju Varghese
https://medium.com/@shijuvar
Microservices & Server...
About Me
• Consulting Solutions Architect and Trainer
• Focused on Golang, Microservices and Cloud-
Native distributed sys...
Agenda
• Inter-Process communications in Microservices
architecture
• Building high performance APIs with gRPC and
Protoco...
Microservices Architecture
Monolithic Architecture
Catalog Management
Customer Accounts
Orders Management
Payment
Monolithic
Database
Monolithic E-Co...
Moving to Microservices
Catalog Management
Customer Accounts
Orders Management
Payment
eCom Store Web
Shipment
Catalog DB
...
Microservices
• Software broken up into functional components
• Componentization via Services in which each service is
pac...
Challenges
• A business transaction may span into multiple
autonomous services
• Decentralization of data management
• Com...
Inter-Process Communications
between Microservices
• Communications over high performance APIs
• Event-Driven architecture...
Design Considerations for Building APIs
• High Performance
• Scaling APIs into millions (even billions) of APIs calls
• Wi...
Why not REST
• Uses HTTP/1.x; Separate TCP Connection per request
• Text on the wire; Not performance efficient
• Harder AP...
gRPC and Protocol Buffers
What is gRPC
• High performance, open-source universal RPC framework
• A Cloud Native Computing Foundation(CNCF) project
•...
Protocol Buffers
• Google's language-neutral, platform-neutral,
extensible mechanism for serialising structured data
• IDL...
Communication between
gRPC Server and Client app
Types of RPC Methods
• Simple RPC
• Server-side streaming RPC
• Client-side streaming RPC
• Bi-directional streaming RPC
gRPC Workflow
ProtoBuf
Definitions
protoc
Compiler
Go
Ruby
Java gRPC Server
gRPC Client
Define1 Compile2
Implement3Generate C...
Demo App
grpc-gateway - gRPC to
JSON Proxy Generator
medium.com/@shijuvar
linkedin.com/in/shijuvar
email: gophermonk@gmail.com
THANK YOU
Articles:
Building High Performance AP...
Upcoming SlideShare
Loading in …5
×

Inter-Process Communication in Microservices using gRPC

Inter-Process Communication in Microservices using gRPC

Inter-Process Communication in Microservices using gRPC

  1. 1. Inter-Process Communication in Microservices using gRPC Shiju Varghese https://medium.com/@shijuvar Microservices & Serverless April 29, 2017, Bangalore
  2. 2. About Me • Consulting Solutions Architect and Trainer • Focused on Golang, Microservices and Cloud- Native distributed systems architectures • Published Author: “Web Development with Go” and “Go Recipes” • Honoured with Microsoft MVP award seven times • Blog: https://medium.com/@shijuvar
  3. 3. Agenda • Inter-Process communications in Microservices architecture • Building high performance APIs with gRPC and Protocol Buffers
  4. 4. Microservices Architecture
  5. 5. Monolithic Architecture Catalog Management Customer Accounts Orders Management Payment Monolithic Database Monolithic E-Commerce App eCom Store Web Shipment
  6. 6. Moving to Microservices Catalog Management Customer Accounts Orders Management Payment eCom Store Web Shipment Catalog DB Accounts DB Orders DB Payment DB Store DB Shipment DB
  7. 7. Microservices • Software broken up into functional components • Componentization via Services in which each service is packaged as one unit of execution • Independent, autonomous process with no dependency on other Microservices • Autonomous services around Bounded Context • Decentralization of data management • Independently replaceable and upgradeable
  8. 8. Challenges • A business transaction may span into multiple autonomous services • Decentralization of data management • Communications between Microservices without having any performance bottleneck
  9. 9. Inter-Process Communications between Microservices • Communications over high performance APIs • Event-Driven architecture using messaging systems
  10. 10. Design Considerations for Building APIs • High Performance • Scaling APIs into millions (even billions) of APIs calls • Wire format; Serialisation and deserialisation of messages • Building streaming APIs • RESTful Vs RPC? • Text encoding Vs binary encoding?
  11. 11. Why not REST • Uses HTTP/1.x; Separate TCP Connection per request • Text on the wire; Not performance efficient • Harder API evolution • Not Domain-Specific • Not strongly-typed • Lack of streaming capabilities
  12. 12. gRPC and Protocol Buffers
  13. 13. What is gRPC • High performance, open-source universal RPC framework • A Cloud Native Computing Foundation(CNCF) project • Open source version of Google’s internal framework Stubby • Uses Protocol Buffers as the IDL • HTTP/2 for transport • Bi-Directional streaming • RPC is efficient, domain-specific and strongly-typed • Works across languages and platforms
  14. 14. Protocol Buffers • Google's language-neutral, platform-neutral, extensible mechanism for serialising structured data • IDL - Describe once and generate interfaces for multiple languages • Structure of the Request and Response • Binary format for network transmission • Supports multiple languages
  15. 15. Communication between gRPC Server and Client app
  16. 16. Types of RPC Methods • Simple RPC • Server-side streaming RPC • Client-side streaming RPC • Bi-directional streaming RPC
  17. 17. gRPC Workflow ProtoBuf Definitions protoc Compiler Go Ruby Java gRPC Server gRPC Client Define1 Compile2 Implement3Generate Code protoc --go_out=plugins=grpc
  18. 18. Demo App
  19. 19. grpc-gateway - gRPC to JSON Proxy Generator
  20. 20. medium.com/@shijuvar linkedin.com/in/shijuvar email: gophermonk@gmail.com THANK YOU Articles: Building High Performance APIs In Go Using gRPC And Protocol Buffers Benchmarking Protocol Buffers, JSON and XML in Go

×