by atul-jalan · 1y ago · 0 comments
send(payload).then(reply => ...)But client and server use it to maintain a record of events.
JSON-RPC is request-response only; the server cannot send unsolicited messages. gRPC supports bidirectional streaming, but I understand that setting it up is more complex than WebSockets.
I will concede that horizontal scaling of RPC is easier because there's no connection overhead.
Ultimately, it really depends on what you're trying to build. I also don't underestimate the cultural aspect; fair or not, JSON-RPC feels very "enterprise microservices" to me. If you think in schemas, RPC might be a good fit.
That solves none of the issues outlined in the post or the comments.
At its core, JSON-RPC boils down to "use `id` and `method` and work the rest out", which is acceptably minimal but does leave you with a lot of other issues to deal with.
Honestly, I'm a little surprised and more than a bit depressed how we effectively reinvent the OSI stack so often...