| > During the last weeks we were more focused on reducing RAM consumption of our databases as that is currently the main driver of cost and operation overhead. < I can imagine that. > Regarding your idea: Wouldn't then the Node.js server have to keep the whole user state in memory? < Yes, but I think it would have several advantages: (1) The Node.js server code could decide which working sets it keeps in memory based on very simple rules. The details of this would be abstracted away from the application code itself, because the app just issues read and write requests on a user's dataset. So in essence, by splitting up the problem in two, it becomes relatively easy to handle (and optimize) on each end. (2) You just have to keep the active datasets wired in RAM and it wouldn't be necessary for the Node server to know whether a user has disconnected recently or not. All it knows is when the data was last accessed and it can then vacate RAM slots that have become stale. Compare this to Redis, which I believe just keeps everything in memory no matter what. So overall RAM usage would probably be considerably less than what you're doing now. (3) The idea beats "dumb blob caching" such as memcache, because it makes small operations economical. It seems to me that Node is well suited for this kind of task since it makes it very easy to build small server scripts that handle a huge number of small transactions. This would probably mean you need less machines for the same amount of users. (4) I believe it's relatively easy to implement replication and scaling. Anyway, just an idea. I have no clue whether this works in practice ;-) |