wilsonlewis
wilsonlewis12mo ago

EventSource vs Multiplex webook

I am setting up an system that needs realtime updates for potentially 100+ different resources on a page. Unfortunately, I'm not familiar with how Deno Deploy handles EventSource connections So, based on Deploy infrastructure, would it be advisable to use 1-1 EventSource for each resource? Or, should I have a single Websocket connection that multiplexes all the resources? Thanks!
1 Reply
Deno AI Helper
Deno AI Helper12mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on general best practices, opening an individual EventSource connection for each resource could potentially lead to a large number of open connections, which might not be the most efficient approach, especially if you're dealing with 100+ different resources. Using a single WebSocket connection that multiplexes all the resources could be more scalable and efficient. This way, you can handle all the updates through a single connection, which can reduce overhead and complexity on both the client and server sides. Please note that this advice is not based on the Deno documentation, and I would recommend double-checking the accuracy of this advice and considering the specific requirements and constraints of your application and the Deno Deploy infrastructure.

Did you find this page helpful?