I am trying to decide whether or not I want to keep track of my online users in a database table or just in memory. In memory seems much easier to me and makes sense because if the server is restarted, I would have to truncate the table everytime the system starts up. Also each user on my system can add contacts (other users) and everytime a user signs on I get the list of users that he or she is friends with and send a signalR message to them that the user is online. So for something like this I feel like getting the data from memory will be much faster, but don’t what will happen when I decide to scale out.
Share
If you need to add more servers to your production environment you will need to keep Session in the database and as a result your list of online users will need to be in the database so that it can be shared across all servers.