• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

cmd/protoc-gen-go-drpc/H16-Sep-2021-

drpccache/H16-Sep-2021-

drpcconn/H16-Sep-2021-

drpcctx/H16-Sep-2021-

drpcdebug/H16-Sep-2021-

drpcenc/H16-Sep-2021-

drpcerr/H16-Sep-2021-

drpchttp/H16-Sep-2021-

drpcmanager/H16-Sep-2021-

drpcmetadata/H16-Sep-2021-

drpcmigrate/H16-Sep-2021-

drpcmux/H16-Sep-2021-

drpcserver/H16-Sep-2021-

drpcsignal/H16-Sep-2021-

drpcstream/H03-May-2022-

drpcwire/H16-Sep-2021-

examples/H16-Sep-2021-

internal/H16-Sep-2021-

scripts/H16-Sep-2021-

.gitignoreH A D16-Sep-202128

.golangci.ymlH A D16-Sep-20217.3 KiB

CODE_OF_CONDUCT.mdH A D16-Sep-20213.6 KiB

JenkinsfileH A D16-Sep-2021928

LICENSEH A D16-Sep-20211 KiB

MakefileH A D16-Sep-20211.6 KiB

README.mdH A D16-Sep-20218.6 KiB

doc.goH A D16-Sep-2021142

drpc.goH A D16-Sep-20213.4 KiB

flake.lockH A D16-Sep-2021992

flake.nixH A D16-Sep-20215 KiB

go.modH A D16-Sep-2021141

go.sumH A D16-Sep-20211 KiB

staticcheck.confH A D16-Sep-202128

README.md

1# [![DRPC](logo.png)](https://storj.github.io/drpc/)
2
3A drop-in, lightweight gRPC replacement.
4
5[![Go Report Card](https://goreportcard.com/badge/storj.io/drpc)](https://goreportcard.com/report/storj.io/drpc)
6[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://pkg.go.dev/storj.io/drpc)
7![Beta](https://img.shields.io/badge/version-beta-green.svg)
8[![Zulip Chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://drpc.zulipchat.com)
9
10## Links
11
12 * [DRPC website](https://storj.github.io/drpc/)
13 * [Examples](https://github.com/storj/drpc/tree/main/examples)
14 * [Quickstart documentation](https://storj.github.io/drpc/docs.html)
15 * [Launch blog post](https://www.storj.io/blog/introducing-drpc-our-replacement-for-grpc)
16
17## Highlights
18
19* Simple, at just a few thousand [lines of code](#lines-of-code).
20* [Small dependencies](./blob/main/go.mod). Only 3 requirements in go.mod, and 9 lines of `go mod graph`!
21* Compatible. Works for many gRPC use-cases as-is!
22* [Fast](#benchmarks). DRPC has a lightning quick [wire format](https://github.com/storj/drpc/wiki/Docs:-Wire-protocol).
23* [Extensible](#external-packages). DRPC is transport agnostic, supports middleware, and is designed around interfaces.
24* Battle Tested. Already used in production for years across tens of thousands of servers.
25
26## External Packages
27
28 * [go.bryk.io/pkg/net/drpc](https://pkg.go.dev/go.bryk.io/pkg/net/drpc)
29    - Simplified TLS setup (for client and server)
30    - Server middleware, including basic components for logging, token-based auth, rate limit, panic recovery, etc
31    - Client middleware, including basic components for logging, custom metadata, panic recovery, etc
32    - Bi-directional streaming support over upgraded HTTP(S) connections using WebSockets
33    - Concurrent RPCs via connection pool
34
35 * Open an issue or join the [Zulip chat](https://drpc.zulipchat.com) if you'd like to be featured here.
36
37## Other Languages
38
39DRPC 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.
40
41Native implementations can have some advantages, and so some bindings 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!
42
43| Language | Repository                          | Status     |
44|----------|-------------------------------------|------------|
45| C++      | https://github.com/storj/drpc-cpp   | Incomplete |
46| Rust     | https://github.com/zeebo/drpc-rs    | Incomplete |
47| Node     | https://github.com/mjpitz/drpc-node | Incomplete |
48
49## Licensing
50
51DRPC is licensed under the MIT/expat license. See the LICENSE file for more.
52
53---
54
55## Benchmarks
56
57These 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.
58
59<table>
60    <tr>
61        <td rowspan=2>Measure</td>
62        <td rowspan=2>Benchmark</td><td rowspan=2></td>
63        <td colspan=3>Small</td><td rowspan=2></td>
64        <td colspan=3>Medium</td><td rowspan=2></td>
65        <td colspan=3>Large</td>
66    </tr>
67    <tr>
68        <td>gRPC</td><td>DRPC</td><td>delta</td>
69        <td>gRPC</td><td>DRPC</td><td>delta</td>
70        <td>gRPC</td><td>DRPC</td><td>delta</td>
71    </tr>
72    <tr><td colspan=14></td></tr>
73    <tr>
74        <td rowspan=4>time/op</td>
75        <td>Unitary</td><td rowspan=4></td>
76        <td>30.2µs</td><td>8.6µs</td><td>-71.60%</td><td rowspan=4></td>
77        <td>38.0µs</td><td>11.1µs</td><td>-70.88%</td><td rowspan=4></td>
78        <td>1.33ms</td><td>0.63ms</td><td>-52.30%</td>
79    </tr>
80    <tr>
81        <td>Input Stream</td>
82        <td>878ns</td><td>759ns</td><td>-13.54%</td>
83        <td>2.85µs</td><td>2.00µs</td><td>-29.69%</td>
84        <td>508µs</td><td>249µs</td><td>-51.08%</td>
85    </tr>
86    <tr>
87        <td>Output Stream</td>
88        <td>862ns</td><td>757ns</td><td>-12.18%</td>
89        <td>2.76µs</td><td>1.99µs</td><td>-27.92%</td>
90        <td>487µs</td><td>239µs</td><td>-50.94%</td>
91    </tr>
92    <tr>
93        <td>Bidir Stream</td>
94        <td>9.81µs</td><td>3.30µs</td><td>-66.38%</td>
95        <td>14.8µs</td><td>4.9µs</td><td>-66.69%</td>
96        <td>1.31ms</td><td>0.55ms</td><td>-58.41%</td>
97    </tr>
98    <tr><td colspan=14></td></tr>
99    <tr>
100        <td rowspan=4>speed</td>
101        <td>Unitary</td><td rowspan=4></td>
102        <td>70.0kB/s</td><td>230.0kB/s</td><td>+228.57%</td><td rowspan=4></td>
103        <td>54.0MB/s</td><td>185.3MB/s</td><td>+243.44%</td><td rowspan=4></td>
104        <td>791MB/s</td><td>1658MB/s</td><td>+109.62%</td>
105    </tr>
106    <tr>
107        <td>Input Stream</td>
108        <td>2.29MB/s</td><td>2.64MB/s</td><td>+15.37%</td>
109        <td>721MB/s</td><td>1026MB/s</td><td>+42.21%</td>
110        <td>2.06GB/s</td><td>4.22GB/s</td><td>+104.32%</td>
111    </tr>
112    <tr>
113        <td>Output Stream</td>
114        <td>2.32MB/s</td><td>2.64MB/s</td><td>+13.67%</td>
115        <td>743MB/s</td><td>1031MB/s</td><td>+38.74%</td>
116        <td>2.15GB/s</td><td>4.39GB/s</td><td>+103.75%</td>
117    </tr>
118    <tr>
119        <td>Bidir Stream</td>
120        <td>200kB/s</td><td>604kB/s</td><td>+201.87%</td>
121        <td>138MB/s</td><td>415MB/s</td><td>+200.20%</td>
122        <td>799MB/s</td><td>1920MB/s</td><td>+140.44%</td>
123    </tr>
124    <tr><td colspan=14></td></tr>
125    <tr>
126        <td rowspan=4>mem/op</td>
127        <td>Unitary</td><td rowspan=4></td>
128        <td>8.37kB</td><td>1.29kB</td><td>-84.59%</td><td rowspan=4></td>
129        <td>21.8kB</td><td>7.7kB</td><td>-64.81%</td><td rowspan=4></td>
130        <td>6.50MB</td><td>3.16MB</td><td>-51.38%</td>
131    </tr>
132    <tr>
133        <td>Input Stream</td>
134        <td>399B</td><td>80B</td><td>-79.96%</td>
135        <td>7.09kB</td><td>2.13kB</td><td>-69.97%</td>
136        <td>3.20MB</td><td>1.05MB</td><td>-67.16%</td>
137    </tr>
138    <tr>
139        <td>Output Stream</td>
140        <td>309B</td><td>80B</td><td>-74.13%</td>
141        <td>6.98kB</td><td>2.13kB</td><td>-69.53%</td>
142        <td>3.20MB</td><td>1.05MB</td><td>-67.17%</td>
143    </tr>
144    <tr>
145        <td>Bidir Stream</td>
146        <td>1.02kB</td><td>0.24kB</td><td>-76.40%</td>
147        <td>14.4kB</td><td>4.3kB</td><td>-69.99%</td>
148        <td>6.52MB</td><td>2.10MB</td><td>-67.74%</td>
149    </tr>
150    <tr><td colspan=14></td></tr>
151    <tr>
152        <td rowspan=4>allocs/op</td>
153        <td>Unitary</td><td rowspan=4></td>
154        <td>169</td><td>7</td><td>-95.86%</td><td rowspan=4></td>
155        <td>171</td><td>9</td><td>-94.74%</td><td rowspan=4></td>
156        <td>403</td><td>9</td><td>-97.76%</td>
157    </tr>
158    <tr>
159        <td>Input Stream</td>
160        <td>11</td><td>1</td><td>-90.91%</td>
161        <td>12</td><td>2</td><td>-83.33%</td>
162        <td>121</td><td>2</td><td>-98.35%</td>
163    </tr>
164    <tr>
165        <td>Output Stream</td>
166        <td>9</td><td>1</td><td>-88.89%</td>
167        <td>10</td><td>2</td><td>-80.00%</td>
168        <td>117</td><td>2</td><td>-98.29%</td>
169    </tr>
170    <tr>
171        <td>Bidir Stream</td>
172        <td>41</td><td>3</td><td>-92.68%</td>
173        <td>44</td><td>5</td><td>-88.64%</td>
174        <td>272</td><td>5</td><td>-98.16%</td>
175    </tr>
176</table>
177
178## Lines of code
179
180| Package                              | Lines    |
181| ---                                  | ---      |
182| storj.io/drpc/drpchttp               | 475      |
183| storj.io/drpc/cmd/protoc-gen-go-drpc | 418      |
184| storj.io/drpc/drpcstream             | 390      |
185| storj.io/drpc/drpcwire               | 332      |
186| storj.io/drpc/drpcmanager            | 300      |
187| storj.io/drpc/drpcmigrate            | 237      |
188| storj.io/drpc/drpcsignal             | 133      |
189| storj.io/drpc/drpcconn               | 116      |
190| storj.io/drpc/drpcmetadata           | 115      |
191| storj.io/drpc/drpcmux                | 95       |
192| storj.io/drpc/drpcserver             | 76       |
193| storj.io/drpc/drpccache              | 54       |
194| storj.io/drpc                        | 47       |
195| storj.io/drpc/drpcerr                | 42       |
196| storj.io/drpc/drpcctx                | 37       |
197| storj.io/drpc/drpcdebug              | 22       |
198| storj.io/drpc/drpcenc                | 15       |
199| storj.io/drpc/internal/drpcopts      | 11       |
200| **Total**                            | **2915** |
201