DEV Community

Discussion on: What's Your Preferred RPC Mechanism and Why?

Collapse
 
bitrage profile image
David Zhang

Interesting note about setting perspectives! Did you end up having to reimplement things like timeout/retry? Did any of these projects involve wrapping messages and passing them on to another process a la microservices? How was the experience doing that?

Collapse
 
bias profile image
Tobias Nickel

the websocket framework was pomelo. it can have many frontend server where websockets clients connect, and backend server that execute the application code. the framework is no longer maintained, so i can not recommend it.

The framework was developed in china, and most documentation and community was in chinese. (i live in shanghai). I would say for some time it was ahead if its time, and developed at netease(chinese internet giant that developed Diablo Immortal with blizzard/microsoft)
but the framework did not age well. The rpc handler can not be async functiona that just return a promise.

And when returning data that dit not have the shape of the protobuffer message, it logged an error of 'invalid message' but did not say what API it was,... it was always happy debugging.

today i would say just use socket.io instead, and using redis it is directly scalable to some degree. I think you can implement retry and timeout in about 20 lines of code. The use of the mongoDB watch command can also be interesting. personally I would leave the fingers off of metheor js.

The project was from a time before docker got so popular. The pomelo framework named it Duck server. a kind of framework dependent microservices, living all in the same repisitory/code-base. We developed a custom solution for zero downtime deployment. an old version server first finish serving the current connections and sessions, before shutting down. While new version servers already got started, and all new traffic got routed to then(connection and network routing done by the pomelo framework).

so yes, interesting approach, that needs a more modern foundation today. and great when very high levels of realtime interactivity are desired/needed.