# drpc **Repository Path**: mirrors_cockroachdb/drpc ## Basic Information - **Project Name**: drpc - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-05-02 - **Last Updated**: 2025-05-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # [](https://storj.github.io/drpc/) A drop-in, lightweight gRPC replacement. [](https://goreportcard.com/report/storj.io/drpc) [](https://pkg.go.dev/storj.io/drpc)  [](https://drpc.zulipchat.com) ## Links * [DRPC website](https://storj.github.io/drpc/) * [Examples](https://github.com/storj/drpc/tree/main/examples) * [Quickstart documentation](https://storj.github.io/drpc/docs.html) * [Launch blog post](https://www.storj.io/blog/introducing-drpc-our-replacement-for-grpc) ## Highlights * Simple, at just a few thousand [lines of code](#lines-of-code). * [Small dependencies](./blob/main/go.mod). Only 3 requirements in go.mod, and 9 lines of `go mod graph`! * Compatible. Works for many gRPC use-cases as-is! * [Fast](#benchmarks). DRPC has a lightning quick [wire format](https://github.com/storj/drpc/wiki/Docs:-Wire-protocol). * [Extensible](#external-packages). DRPC is transport agnostic, supports middleware, and is designed around interfaces. * Battle Tested. Already used in production for years across tens of thousands of servers. ## External Packages * [go.bryk.io/pkg/net/drpc](https://pkg.go.dev/go.bryk.io/pkg/net/drpc) - Simplified TLS setup (for client and server) - Server middleware, including basic components for logging, token-based auth, rate limit, panic recovery, etc - Client middleware, including basic components for logging, custom metadata, panic recovery, etc - Bi-directional streaming support over upgraded HTTP(S) connections using WebSockets - Concurrent RPCs via connection pool * [go.elara.ws/drpc](https://pkg.go.dev/go.elara.ws/drpc) - Concurrent RPCs based on [yamux](https://pkg.go.dev/github.com/hashicorp/yamux) - Simple drop-in replacements for `drpcserver` and `drpcconn` * Open an issue or join the [Zulip chat](https://drpc.zulipchat.com) if you'd like to be featured here. ## Examples * [A basic drpc client and server](../../tree/main/examples/drpc) * [A basic drpc client and server that also serves a Twirp/grpc-web compatible http server on the same port](../../tree/main/examples/drpc) * [Serving gRPC and DRPC on the same port](../../tree/main/examples/grpc_and_drpc) ## Other Languages DRPC can be made compatible with RPC clients generated from other languages. For example, [Twirp](https://github.com/twitchtv/twirp) clients and [grpc-web](https://github.com/grpc/grpc-web/) clients can be used against the [drpchttp](https://pkg.go.dev/storj.io/drpc/drpchttp) package. Native implementations can have some advantages, and so some support for other languages are in progress, all in various states of completeness. Join the [Zulip chat](https://drpc.zulipchat.com) if you want more information or to help out with any! | Language | Repository | Status | |----------|-------------------------------------|------------| | C++ | https://github.com/storj/drpc-cpp | Incomplete | | Rust | https://github.com/zeebo/drpc-rs | Incomplete | | Node | https://github.com/mjpitz/drpc-node | Incomplete | ## Licensing DRPC is licensed under the MIT/expat license. See the LICENSE file for more. --- ## Benchmarks These microbenchmarks attempt to provide a comparison and come with some caveats. First, it does not send data over a network connection which is expected to be the bottleneck almost all of the time. Second, no attempt was made to do the benchmarks in a controlled environment (CPU scaling disabled, noiseless, etc.). Third, no tuning was done to ensure they're both performing optimally, so there is an inherent advantage for DRPC because the author is familiar with how it works.
Measure | Benchmark | Small | Medium | Large | |||||||||
gRPC | DRPC | delta | gRPC | DRPC | delta | gRPC | DRPC | delta | |||||
time/op | Unitary | 29.7µs | 8.3µs | -72.18% | 36.4µs | 11.3µs | -68.92% | 1.70ms | 0.54ms | -68.24% | |||
Input Stream | 1.56µs | 0.79µs | -49.07% | 3.80µs | 2.04µs | -46.28% | 784µs | 239µs | -69.48% | ||||
Output Stream | 1.51µs | 0.78µs | -48.47% | 3.81µs | 2.02µs | -47.06% | 691µs | 224µs | -67.55% | ||||
Bidir Stream | 8.79µs | 3.25µs | -63.07% | 13.7µs | 5.0µs | -63.73% | 1.73ms | 0.47ms | -72.72% | ||||
speed | Unitary | 70.0kB/s | 240.0kB/s | +242.86% | 56.3MB/s | 181.1MB/s | +221.52% | 618MB/s | 1939MB/s | +213.84% | |||
Input Stream | 1.28MB/s | 2.52MB/s | +96.11% | 540MB/s | 1006MB/s | +86.16% | 1.34GB/s | 4.38GB/s | +226.51% | ||||
Output Stream | 1.33MB/s | 2.57MB/s | +93.88% | 538MB/s | 1017MB/s | +89.14% | 1.52GB/s | 4.68GB/s | +208.05% | ||||
Bidir Stream | 230kB/s | 616kB/s | +167.93% | 149MB/s | 412MB/s | +175.73% | 610MB/s | 2215MB/s | +262.96% | ||||
mem/op | Unitary | 9.42kB | 1.42kB | -84.95% | 22.7kB | 7.8kB | -65.61% | 6.42MB | 3.16MB | -50.74% | |||
Input Stream | 465B | 80B | -82.80% | 7.06kB | 2.13kB | -69.87% | 3.20MB | 1.05MB | -67.10% | ||||
Output Stream | 360B | 80B | -77.81% | 6.98kB | 2.13kB | -69.52% | 3.20MB | 1.05MB | -67.21% | ||||
Bidir Stream | 1.09kB | 0.24kB | -77.94% | 14.4kB | 4.3kB | -69.90% | 6.42MB | 2.10MB | -67.22% | ||||
allocs/op | Unitary | 182 | 7 | -96.15% | 184 | 9 | -95.11% | 280 | 9 | -96.79% | |||
Input Stream | 11 | 1 | -90.91% | 12 | 2 | -83.33% | 39.2 | 2 | -94.90% | ||||
Output Stream | 11 | 1 | -90.91% | 12 | 2 | -83.33% | 38 | 2 | -94.74% | ||||
Bidir Stream | 43 | 3 | -93.02% | 46 | 5 | -89.13% | 140 | 5 | -96.43% |