by joshxyz · 5y ago · 0 comments
No need to write wrappers for Fetch, network errors and reconnects can be handled on high-level, handlers for each message type can be mounted and unmounted on useEffect hooks, all back-end jobs can notify the user in realtime, all session-based client-side data can be updated in realtime (in single or multiple open tabs).
I'm also using uWebSockets.js[0] which is great in terms of API design, stability, and performance. Their benchmarks[1] are just convincing. Highly recommend people using ExpressJS / Koa / whatever to try it.
[0] https://github.com/uNetworking/uWebSockets.js/
[1] https://github.com/uNetworking/uWebSockets/tree/master/bench...
It's just almost pure luck that the guy who wrote uWebSockets (written in C & C++) also wrote NodeJS bindings, otherwise we'll be stuck with the ones with sub-par api, docs, and performance.
Needs a fairly capable server though, I suppose. One that can handle lots and lots of open websocket connections.
Sounds like 30 GiB RAM for 1 million concurrent users is not unreasonable:
* Anecdotal of course, at least for us.