Hacker News new | ask | show | jobs
by boutell 832 days ago
Can attest - for similar use cases. I did much the same (shameless plug, just like the original): https://friendsyeights.com/

Game state is kept in memory, the server is single process (Node.js as it happens), connections use websockets, it just works.

Does it scale? No. Could it scale with a similar approach? Sure, with some additional work: separate games could be distributed over many instances (a sharding strategy). There's no redundancy there, but it's a game, not a credit card processing system.

However, I do snapshot game state in JSON files on disk so that games are not terminated by every new deployment. In a single-process model, that's safe when using synchronous filesystem calls. Just don't try it in a multithreaded system. Though it may take many moons, you will eventually lose your "poor man's database" to a race condition.

Still, would I use this technique to host people's taxes? Hard no. I wouldn't even use it to host their blog posts. Durability matters for those use cases.