SlideShare una empresa de Scribd logo
1 de 17
1.Apa itu gRPC?
Bahasa Indonesia
Sejarah gRPC
● Tahun 2015 Google mempublikasikan gRPC,
yang sekarang digunakan di banyak organisasi di
luar Google untuk memberdayakan kasus
penggunaan dari microservice. gRPC
menggunakan HTTP/2 untuk transport, Protocol
Buffers untuk interface description language,and
memiliki fitur authentication, bidirectional
streaming and flow control, blocking atau
nonblocking bindings, dan cancellation dan
timeouts. gRPC juga generate cross-platform
client dan server bindings untuk banyak bahasa
pemrograman
● gRPC kepanjangan dari Google Remote
Procedure call.
● gRPC adalah teknik remote procedure call (RPC)
yang membawa fitur-fitur modern ke aplikasi client
- server.
● gRPC dapat memanggil fungsi langsung di
komputer yang lain walaupun menggunakan
bahasa pemrograman yang berbeda
Source https://grpc.io/docs/what-is-grpc/introduction/
Bahasa yang official support gRPC
● C# / .NET
● C++
● Dart
● Go
● Java
● Kotlin
● Node
● Objective-C
● PHP
● Python
● Ruby
https://grpc.io/docs/languages/
HTTP 2.0
Source: https://freecontent.manning.com/animation-http-1-1-vs-http-2-vs-http-2-with-push/
Protocol Buffer
Source: https://www.xenonstack.com/insights/google-protocol-buffer/
https://medium.com/@philipshen13/a-short-introduction-to-grpc-419b620e2177
gRPC API Service Method
1. A unary service method takes one input and
returns one output.
2. A server streaming service method receives
one input from the client and sends a stream
of outputs. It can also send back multiple
outputs as data becomes available.
3. Client streaming service methods open a
connection to a server, and then when the
server acknowledges the stream can begin,
the client side can begin sending data until it
terminates the stream.
4. Bidirectional streaming service methods
simultaneously send and receive data
streams in both directions.
Source: https://blog.knoldus.com/unary-streaming-via-grpc/
gRPC Flow
pic source:https://blog.bytebytego.com/p/ep32-how-does-grpc-work
Step 1: A REST call is made from the client. The request
body is usually in JSON format.
Steps 2 - 4: The order service (gRPC client) receives the
REST call, transforms it, and makes an RPC call to the
payment service. gPRC encodes the client stub into a
binary format and sends it to the low-level transport layer.
Step 5: gRPC sends the packets over the network via
HTTP2. Because of binary encoding and network
optimizations, gRPC is said to be 5X faster than JSON.
Steps 6 - 8: The payment service (gRPC server) receives
the packets from the network, decodes them, and invokes
the server application.
Steps 9 - 11: The result is returned from the server
application, and gets encoded and sent to the transport
layer.
Steps 12 - 14: The order service receives the packets,
decodes them, and sends the result to the client application.
Tools testing gRPC (1) : postman
https://blog.postman.com/postman-now-supports-grpc/
Tools testing gRPC (2) : BloomRPC
https://github.com/bloomrpc/bloomrpc
Tools testing gRPC (3) : gRPCCurl
https://github.com/fullstorydev/grpcurl
02. Instalasi gRPC dengan GO
Bahasa Indonesia
Instalasi
1. Golang versi terakhir
https://go.dev/doc/devel/release
2. Protocol Buffer compiler
https://github.com/protocolbuffers/protobuf/releases
1. Go plugins for the protocol compiler
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
Instalasi protocol buffer (1)
1. kunjungi https://github.com/protocolbuffers/protobuf/releases
2. download binary
3. setting environment variable
Instalasi protocol buffer (2)
Instalasi protocol buffer (3)
Instalasi protocol buffer (4)
$ git clone -b v1.50.0 --depth 1 https://github.com/grpc/grpc-go
$ go run greeter_server/main.go
download contoh project
run server grpc
run server client
$ go run greeter_client/main.go
Generate proto
$ protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-
grpc_opt=paths=source_relative helloworld/helloworld.proto

Más contenido relacionado

Similar a Apa itu gRPC_.pptx

Similar a Apa itu gRPC_.pptx (20)

gRPC services testing
gRPC services testinggRPC services testing
gRPC services testing
 
GRPC.pptx
GRPC.pptxGRPC.pptx
GRPC.pptx
 
Driving containerd operations with gRPC
Driving containerd operations with gRPCDriving containerd operations with gRPC
Driving containerd operations with gRPC
 
Cloud native IPC for Microservices Workshop @ Containerdays 2022
Cloud native IPC for Microservices Workshop @ Containerdays 2022Cloud native IPC for Microservices Workshop @ Containerdays 2022
Cloud native IPC for Microservices Workshop @ Containerdays 2022
 
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
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golang
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer Protocol
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
Modern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in GolangModern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in Golang
 
gRPC
gRPC gRPC
gRPC
 
GRPC 101 - DevFest Belgium 2016
GRPC 101 - DevFest Belgium 2016GRPC 101 - DevFest Belgium 2016
GRPC 101 - DevFest Belgium 2016
 
Remote procedure calls
Remote procedure callsRemote procedure calls
Remote procedure calls
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
 
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
 
NGINX: HTTP/2 Server Push and gRPC
NGINX: HTTP/2 Server Push and gRPCNGINX: HTTP/2 Server Push and gRPC
NGINX: HTTP/2 Server Push and gRPC
 
Introduction to gRPC
Introduction to gRPCIntroduction to gRPC
Introduction to gRPC
 
Grpc present
Grpc presentGrpc present
Grpc present
 
KrakenD API Gateway
KrakenD API GatewayKrakenD API Gateway
KrakenD API Gateway
 
gRPC Design and Implementation
gRPC Design and ImplementationgRPC Design and Implementation
gRPC Design and Implementation
 
Akka gRPC quick-guide
Akka gRPC quick-guideAkka gRPC quick-guide
Akka gRPC quick-guide
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Apa itu gRPC_.pptx

  • 2. Sejarah gRPC ● Tahun 2015 Google mempublikasikan gRPC, yang sekarang digunakan di banyak organisasi di luar Google untuk memberdayakan kasus penggunaan dari microservice. gRPC menggunakan HTTP/2 untuk transport, Protocol Buffers untuk interface description language,and memiliki fitur authentication, bidirectional streaming and flow control, blocking atau nonblocking bindings, dan cancellation dan timeouts. gRPC juga generate cross-platform client dan server bindings untuk banyak bahasa pemrograman ● gRPC kepanjangan dari Google Remote Procedure call. ● gRPC adalah teknik remote procedure call (RPC) yang membawa fitur-fitur modern ke aplikasi client - server. ● gRPC dapat memanggil fungsi langsung di komputer yang lain walaupun menggunakan bahasa pemrograman yang berbeda Source https://grpc.io/docs/what-is-grpc/introduction/
  • 3. Bahasa yang official support gRPC ● C# / .NET ● C++ ● Dart ● Go ● Java ● Kotlin ● Node ● Objective-C ● PHP ● Python ● Ruby https://grpc.io/docs/languages/
  • 6. gRPC API Service Method 1. A unary service method takes one input and returns one output. 2. A server streaming service method receives one input from the client and sends a stream of outputs. It can also send back multiple outputs as data becomes available. 3. Client streaming service methods open a connection to a server, and then when the server acknowledges the stream can begin, the client side can begin sending data until it terminates the stream. 4. Bidirectional streaming service methods simultaneously send and receive data streams in both directions. Source: https://blog.knoldus.com/unary-streaming-via-grpc/
  • 7. gRPC Flow pic source:https://blog.bytebytego.com/p/ep32-how-does-grpc-work Step 1: A REST call is made from the client. The request body is usually in JSON format. Steps 2 - 4: The order service (gRPC client) receives the REST call, transforms it, and makes an RPC call to the payment service. gPRC encodes the client stub into a binary format and sends it to the low-level transport layer. Step 5: gRPC sends the packets over the network via HTTP2. Because of binary encoding and network optimizations, gRPC is said to be 5X faster than JSON. Steps 6 - 8: The payment service (gRPC server) receives the packets from the network, decodes them, and invokes the server application. Steps 9 - 11: The result is returned from the server application, and gets encoded and sent to the transport layer. Steps 12 - 14: The order service receives the packets, decodes them, and sends the result to the client application.
  • 8. Tools testing gRPC (1) : postman https://blog.postman.com/postman-now-supports-grpc/
  • 9. Tools testing gRPC (2) : BloomRPC https://github.com/bloomrpc/bloomrpc
  • 10. Tools testing gRPC (3) : gRPCCurl https://github.com/fullstorydev/grpcurl
  • 11. 02. Instalasi gRPC dengan GO Bahasa Indonesia
  • 12. Instalasi 1. Golang versi terakhir https://go.dev/doc/devel/release 2. Protocol Buffer compiler https://github.com/protocolbuffers/protobuf/releases 1. Go plugins for the protocol compiler $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
  • 13. Instalasi protocol buffer (1) 1. kunjungi https://github.com/protocolbuffers/protobuf/releases 2. download binary 3. setting environment variable
  • 16. Instalasi protocol buffer (4) $ git clone -b v1.50.0 --depth 1 https://github.com/grpc/grpc-go $ go run greeter_server/main.go download contoh project run server grpc run server client $ go run greeter_client/main.go
  • 17. Generate proto $ protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go- grpc_opt=paths=source_relative helloworld/helloworld.proto