12 karma · joined Oct 26, 2011 (15y ago) · 7 submissions
comment 15y ago · link · parent
Regarding your idea: Wouldn't then the Node.js server have to keep the whole user state in memory?
comment 15y ago · link · parent
comment 15y ago · link · parent
comment 15y ago · link · parent
comment 15y ago · link · parent
You are correct in your assumption that each Tile had been a record in a MySQL table (now it is a value i a Redis hash).
Actually we considered using a "blob" approach. But in the client we cannot batch requests as we cannot foresee when the user will simply kill the Flash client to go to some other site. So when a user request (i.e. a game event) arrives in the server there is no way to know if another request will follow. So we have to persist that change right away.
This is using a stateless server. In a later game called Magic Land we are going for a stateful Erlang server. There we keep the whole user state in RAM while the user plays and persist state changes every minute or so. Here we can do without any database and just use S3 for persistence. Works just great. On the upcoming Erlang User Conference we will give an update on that project and slides will be available at Slideshare next week, too. In the meantime please have a look at this old slide set to explain the concept in detail: http://www.slideshare.net/wooga/erlang-the-big-switch-in-soc...