4 ms·
This is super interesting! Do you have any data on how well this scales when running on Cloudflare Edge? Can you run more than one instance and have them share
by dabeeeenster 4y ago
This is super interesting! Do you have any data on how well this scales when running on Cloudflare Edge? Can you run more than one instance and have them share state?
- paulgb 4y agoThanks! When hosted on Cloudflare, it uses their Durable Objects product. Rather than running multiple backend instances that share state, it's set up so that all users in the same "room" are connected to the same instance. The instances can then be scaled out horizontally (but Cloudflare takes care of that.) Within a room, things are a bit more constrained. We haven't found the limit yet, and I suspect it's pretty high, but our design goal was to support on the order of dozens of users in a room, not necessarily beyond that. (Targeting e.g. a shared whiteboard use case)
- tmikaeld 4y agoWe also looked at using Cloudflare, but it was prohibitively expensive, because you pay for the duration of each "room" (Connection, depending on how you use it). https://developers.cloudflare.com/workers/platform/pricing/#durable-objects https://developers.cloudflare.com/workers/platform/pricing/#... Eventually we went with Centrifuge.
- paulgb 4y agoYeah, it remains to be seen whether it is economical for us to keep the hosted version on CF. I suspect that for users who want to run their own geographically distributed instance of it, CF will be the path that makes sense for the majority of them. Who did you end up going with as a hosting provider? (Centrifuge looks to be a library, if I’m looking at the right thing)
- tmikaeld 4y agohttps://github.com/centrifugal/centrifugo https://github.com/centrifugal/centrifugo (Server/Admin) https://github.com/centrifugal/centrifuge https://github.com/centrifugal/centrifuge (Server core) https://github.com/centrifugal/centrifuge-js https://github.com/centrifugal/centrifuge-js (Library) It's a complete solution, including server, admin panel and client library. We're an European company and use OVH, Hetzner and others.
- e1g 4y ago"Centrifuge" as in https://github.com/centrifugal/centrifugo https://github.com/centrifugal/centrifugo ?
- unraveller 4y agoCF edge wants you to be more one and done, very anti connection. Deno is the better priced edgejs compute for websockets last I checked. Probably still worthwhile for DriftDB SaaS if mainly short lived connections are used, even though similar functionality can be had with NATS bridge + an ordered streaming library in your fav language on fly.io
- crabmusket 4y agoI can't find any mention of websockets in Deno Deploy's documentation. Last I heard they had not released anything. But I'm really hoping for more providers to copy CloudFlare's edge features, especially durable objects.