# Core Concepts, Architecture and Lifecycle ![rw-book-cover](https://grpc.io/img/logos/grpc-icon-color.png) ## Metadata - Author: [[gRPC]] - Full Title: Core Concepts, Architecture and Lifecycle - Category: #articles - Summary: gRPC is a system for defining services and calling methods remotely using protocol buffers to describe the service and messages. It supports different types of Remote Procedure Calls (RPCs), including unary, server-streaming, client-streaming, and bidirectional streaming. Clients and servers can manage timeouts, cancel calls, and use metadata to share information during the RPC process. - URL: https://grpc.io/docs/what-is-grpc/core-concepts/ ## Highlights - Like many RPC systems, gRPC is based around the idea of defining a service, specifying the methods that can be called remotely with their parameters and return types ([View Highlight](https://read.readwise.io/read/01k36v1kx2f52xccg653s77qj9)) - By default, gRPC uses [protocol buffers](https://developers.google.com/protocol-buffers) as the Interface Definition Language (IDL) for describing both the service interface and the structure of the payload messages. ([View Highlight](https://read.readwise.io/read/01k36v1v2jntnxs2yvfx3pd3xt)) - gRPC lets you define four kinds of service method: ([View Highlight](https://read.readwise.io/read/01k36v22xgt3gekd3nr6sjgfyv)) - Unary RPCs where the client sends a single request to the server and gets a single response back, just like a normal function call. rpc SayHello(HelloRequest) returns (HelloResponse); ([View Highlight](https://read.readwise.io/read/01k36v25vmg3t2q2d3s3jsk76f)) - Server streaming RPCs where the client sends a request to the server and gets a stream to read a sequence of messages back. The client reads from the returned stream until there are no more messages. gRPC guarantees message ordering within an individual RPC call. rpc LotsOfReplies(HelloRequest) returns (stream HelloResponse); ([View Highlight](https://read.readwise.io/read/01k36v2v4eqkc00p5jq0jwfjx1)) - Client streaming RPCs where the client writes a sequence of messages and sends them to the server, again using a provided stream. Once the client has finished writing the messages, it waits for the server to read them and return its response. Again gRPC guarantees message ordering within an individual RPC call. rpc LotsOfGreetings(stream HelloRequest) returns (HelloResponse); ([View Highlight](https://read.readwise.io/read/01k36v34rbfcy200beq3hcyye5)) - Bidirectional streaming RPCs where both sides send a sequence of messages using a read-write stream. The two streams operate independently, so clients and servers can read and write in whatever order they like: for example, the server could wait to receive all the client messages before writing its responses, or it could alternately read a message then write a message, or some other combination of reads and writes. The order of messages in each stream is preserved. rpc BidiHello(stream HelloRequest) returns (stream HelloResponse); ([View Highlight](https://read.readwise.io/read/01k36v3rm5fha0ahp8ffg31634)) - gRPC provides protocol buffer compiler plugins that generate client- and server-side code. gRPC users typically call these APIs on the client side and implement the corresponding API on the server side. ([View Highlight](https://read.readwise.io/read/01k36vfs9mwqe7gb1k389ayae0)) - On the server side, the server implements the methods declared by the service and runs a gRPC server to handle client calls. ([View Highlight](https://read.readwise.io/read/01k36vg3ry43dsq93rcjq4rex8))