It is said that key-value stores are better for storing persistent data, comparing to relational databases, not comparing to non-persisted in-memory objects.
But I suspect that a key-value database has advantages when compared to object variables, even when persistence is not a need. They can be shared among apps and can spare the memory consumption. Even Redis, which stores all values in memory, can save you memory from your application server because it can be migrated to another server when consuming a lot of gigabytes.
Also, an in-memory, shared object tends to become complex to maintain over time. If you decide to use it, I recommend you to abstract its nature. Have a object where you just do something like this in your code:
var storage = new Storage();
storage.registerClientDisconnection("client_id_1");
Then, your Storage.registerClientDisconnection()
can be either
Storage.proptotype.registerClientDisconnection = function(clientId) {
this.info[clientId].connected = false;
};
or
Storage.proptotype.registerClientDisconnection = function(clientId) {
var client = redis.createClient();
client.set("clientId:"+clientId+":connected", false);
};
Summarizing: I would recommend to use some key-value store but I bet you could use some object storage, too. However, if you decide to use an in-memory object, just abstract this implementation detail so you can easily migrate for a key-value store implementation in the future. Abstracting your decision seems more important than your decision about the implementation.