
Tonic
A Rust library for building gRPC clients and servers with async/await support.grpc/grpc-rust
- Stars
- 12.5k
- Forks
- 1.3k
- Licence
- MIT
- Language
- Rust
- Last update
- 6 days ago
- Type
- Library
What it is
Tonic is a Rust library for gRPC, a framework for remote procedure calls where a program calls functions on another program over the network. It runs over HTTP/2 and supports async/await, so developers can write both the client and server side in Rust. The README describes it as a core building block for production systems.
- Define a service in a .proto file and generate Rust client and server code with tonic-build
- Build a server that streams responses back to clients
- Add TLS to a gRPC service using rustls
- Add a standard gRPC health checking endpoint with tonic-health
Great for
- Rust developers building services that talk over gRPC
- Teams that want async/await support in their network services
- Projects that need streaming, TLS, or health checks in a gRPC service
- Developers who want generated client and server code from Protocol Buffers definitions
Not ideal for
- People who do not write Rust, since this is a Rust library and needs a Rust toolchain
- Projects that do not use gRPC or Protocol Buffers, since the library is specific to that stack
- Beginners with no grounding in async Rust, since the README does not offer a gentle introduction to async concepts
How to get it
- 1
Install with a package manager
You'll need: Rust toolchain (MSRV 1.88) · protoc (Protocol Buffers compiler) for some code generation APIs
Clone the repository
git clone https://github.com/grpc/grpc-rust - 2
Run it
- Install the Rust toolchain at version 1.88 or newer
- Install protoc if you plan to use tonic_build::compile_protos()
- Work through the helloworld tutorial in examples/helloworld-tutorial.md
- Try the routeguide tutorial for a fuller example
- 3
Get the most out of it
- Read the helloworld and routeguide tutorials in order, since they cover basic and advanced usage
- Use tonic-health for a standard health checking service
- Use tonic-reflection to add a gRPC reflection service
- Check the examples directory for TLS, load balancing, and bi-directional streaming samples
- Browse the API docs on docs.rs for details on each crate
Downloads
Strengths
- Built for async/await from the start, on top of the tokio and hyper ecosystem
- Covers common needs such as bi-directional streaming, TLS, load balancing, and authentication
- Includes helloworld and routeguide tutorials for first-time users
Trade-offs
- Requires a Rust toolchain at MSRV 1.88 or newer, and the protoc compiler for some code generation APIs
- The master branch is preparing breaking changes, so users wanting stable code should use the 0.14.x branch
- Some features listed (such as load balancing) are described only briefly in the README, so details need the examples or docs
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| grpc-rust (this) | 12.5k | Library | intermediate | 6 days ago | Rust developers building services that talk over gRPC |
| go-zero | 33.4k | Library | intermediate | 5 days ago | Go developers building REST APIs or microservices |
| kratos | 26k | Library | intermediate | 4 days ago | Go developers building a set of backend services that talk over HTTP or gRPC |
| fastapi | 105k | Library | beginner | 4 days ago | Python developers building JSON APIs or back-end services |
| query | 50.5k | Library | intermediate | 4 days ago | Frontend developers building apps that load data from a server |
| async | 28.1k | Library | intermediate | 5 days ago | JavaScript developers who need to run many asynchronous operations over a collection of items |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.