I performed the exact opposite migration at $DAYJOB recently - swapping an internal text-based protocol to HTTP (over a local IPC pipe). The main benefit was we could suddenly reuse all the codegenerated routers/docs/authentication from the HTTP ecosystem. It significantly simplified/standardised our IPC layer and reduced the "weirdness" in the codebase.
RPC Olympics – The Search for the Perfect RPC Protocol
11–20 of 71 posts
Re: RPC Olympics – The Search for the Perfect RPC Protocol
#12If you're on the same machine then pipes, unix sockets and shared memory are even faster options.
Re: RPC Olympics – The Search for the Perfect RPC Protocol
#13Re: RPC Olympics – The Search for the Perfect RPC Protocol
#14While GRPC has its place it also comes with headaches like pretty lousy generated interfaces, horrible debuggability, and unpredictable scaling.
Re: RPC Olympics – The Search for the Perfect RPC Protocol
#15For fullstack dev, I've been immensely happy with grpc/protobuf over http because of the type safety I get communicating between Golang and Typescript. This eliminates a whole class of bugs but is only a serialization benefit.
Generally: use the thing with the best tooling!
Re: RPC Olympics – The Search for the Perfect RPC Protocol
#16Strong recommendation for ZeroMQ as well. It's a thin layer on TCP, is very fast, offers bindings in many languages, and is fairly flexible as well. https://zeromq.org/
Re: RPC Olympics – The Search for the Perfect RPC Protocol
#17Re: RPC Olympics – The Search for the Perfect RPC Protocol
#18My current rpc model for python is to pickle function name and args/kwargs and publish to redis for any subscribers that might be listening. If the channel is marked as persisting, I put the message to a hashset with current nanosecond as the timestamp and just send a ping instead. It is pretty fast with asyncio redis client clocking at an avg 15k rpc/s on a single core with uvloop on a lowly i7
Re: RPC Olympics – The Search for the Perfect RPC Protocol
#19The most important thing that I found out while doing my research is it's not the fastest bytes that win. Well, that does matter, but it's not that important. It's reducing performance variance [1]. While my project wasn't optimizing for speed, it was optimizing for zero-copy de/serialization, but this often ends up as a solution for high-speed transfers. SBE, Flattbuffers, Cap'n Proto all had their places, but I ended up not using any of those and just hand-rolling something similar to what SBE would do. If this was a $DAYJOB project I'd probably end up doing something with SBE.
[1]: https://speice.io/2019/07/high-performance-systems.html