logoalt Hacker News

nickandbroyesterday at 9:03 PM2 repliesview on HN

Very cool, though wouldn't using durable objects for a MMO type game become prohibitively expensive vs using websockets with a stateful server? I assume your game is not sending that many requests so its not too bad.


Replies

parzivaltyesterday at 9:13 PM

good question. it's not real-time - actions resolve over hours.... request rate per active player is single digits per minute, often zero. DO alarms handle the time-based stuff (fleet arrivals, combat resolution, resource ticks) so there's no persistent connection cost. so far costs have been negligible compared to running an always-on origin.

websockets + stateful server would be the right call for anything realtime. for tick-based strategy with hour-long timers, DOs feel like the cleanest fit - i get per-island isolation, alarms, and storage in one primitive without managing a connection pool.

sophaclesyesterday at 9:13 PM

Durable objects do websockets

show 1 reply