Great question. Since nosflare uses Workers, it will connect to a worker that’s closest to your IP’s location and establish the websocket connection from there. It then carries through to the regional durable object and further down to a read replica with the database that’s also regionally available. This should make the entire round trip connection occur within the closest proximity of each user. The only part it wouldn’t would be writing to the database (which would still only be marginal overhead of a few tens of milliseconds, but still spread through the respective regional durable object) or if an event is older than 3 months it would pull from the R2 bucket. Let me know if you have any further questions!

Reply to this note

Please Login to reply.

Discussion

Damn. That's way more than I was expecting to learn.

It's an interesting architecture for scaling, I did consider something similar (and still do), using Azure Front Door which is similar technology.

Instead I decided to go with more distributed architecture, where user's go directly to relays and media servers that are in the different regions. This way there is less centralized point of entry, becomes a bit more resilient I think.

A hybrid model is also possible, e.g.: "asia dot myservice dot com", and behind that domain you do backend scaling, DDOS protection, backup, etc.