
gRPC
Protocol Buffers, gRPC services, streaming, interceptors, error handling, metadata
1What is gRPC?
What is gRPC?
Risposta
gRPC is an open-source RPC (Remote Procedure Call) framework developed by Google that uses HTTP/2 as transport protocol and Protocol Buffers as the default serialization format. Unlike REST which uses JSON and HTTP/1.1, gRPC offers better performance thanks to Protocol Buffers' binary format and HTTP/2 advanced features (multiplexing, header compression, server push). gRPC is widely used for microservices communication because it natively supports bidirectional streaming, client/server code generation, and strongly-typed interfaces.
2What is the main role of Protocol Buffers in gRPC?
What is the main role of Protocol Buffers in gRPC?
Risposta
Protocol Buffers (protobuf) is the Interface Definition Language (IDL) and binary serialization format used by default in gRPC. It allows defining message structures and services in .proto files, which are then compiled to automatically generate client and server code in different languages. Protobuf's binary format is 3 to 10 times more compact than JSON and offers significantly superior serialization/deserialization performance (up to 20 times faster). This makes gRPC particularly suitable for high-frequency communication between microservices.
3What is the difference between a Unary gRPC call and a Server Streaming call?
What is the difference between a Unary gRPC call and a Server Streaming call?
Risposta
A Unary call is the simplest gRPC call type: the client sends a single request and receives a single response, similar to a classic HTTP REST request. A Server Streaming call allows the client to send a single request but receive a stream of multiple responses from the server. For example, a notifications API can use Server Streaming to send multiple updates to the client without the client having to poll. This reduces latency and network overhead compared to repeated Unary calls.
Which Go package is used to create a gRPC server?
How to define a gRPC service in a .proto file?
+19 domande da colloquio
Altri argomenti di colloquio Go
Go Basics
Go Data Structures
Go Interfaces
Error Handling
Goroutines Basics
Channels
Go Modules
HTTP Server
HTTP Client
JSON Encoding
database/sql
Context Package
Testing
Concurrency Patterns
Sync Primitives
Go Web Frameworks
REST API Design
Reflection
Memory Management
Performance Optimization
Generics
Go Design Patterns
Microservices
Security & Authentication
Docker & Containerization
Kubernetes Basics
Advanced Go
CLI Development
Padroneggia Go per il tuo prossimo colloquio
Accedi a tutte le domande, flashcards, test tecnici, esercizi di code review e simulatori di colloquio.
Inizia gratis