0

I am trying to implement multi-channel session management.

What I mean for multi-channel is that user may login from mobile or from internet or from different channel. I do not want them to login from different channels at the same time.

For example, Internet and Mobile have different servers in the different clusters. Current systems goes to database to check if there is any session for that user.

However, I do not want servers to check database all the time due to the possible performance problems.

What could be the best multi-channel session management methods without checking database every time ?

ahmet gül
  • 193
  • 1
  • 11

1 Answers1

1

If you have separate servers, you will need a centralized piece of state to manage it. There is no getting around that fact. You can use something more high-performant than a SQL database (memcached or similar) but you will add latency if you need to verify it on every request.

If you can let a request or two go through, then you could come up with an asynchronous update mechanism where the state is cached on the local server, and the request sends a cache refresh to the centralized server to get the state refreshed. This would allow the current user to avoid latency, with the caveat that one or two requests could get through (due to parallelism).

Rob Conklin
  • 8,806
  • 1
  • 19
  • 23