0

I am currently working on a .NET Core REST styled API that is written in Microservices and we were not maintaining any state but then we had this requirement of keeping a track of logged in users.

fortunately, we are using SignalR for real-time data updation for every logged in user and that seems like the most accurate option to maintain the state of the logged-in users by having some static Data Structure in memory and maintaining the list of logged-in users but statics do not work well in web server farms, also we will lose our state on any server refresh

That said, now I have to save the state that is not user-related and I want to do it efficiently and I don't think SQL Server will be a good option to maintain the state so I'm not really sure where to go from here.

What do you think the best option for non-user-related state management in this particular scenario?

Any help will be highly appreciated.

Zeeshan Adil
  • 1,937
  • 5
  • 23
  • 42
  • Your question is too broad. In general, you have `IDistributedCache`. It can be backed by SQL Server or Redis out of the box, but you can add your own providers. – Chris Pratt Sep 24 '19 at 17:16
  • @ChrisPratt Thanks for pointing out, I just edited my question and I'm just looking for a good option for state management. I will have a look at IDistributedCache – Zeeshan Adil Sep 24 '19 at 17:20

0 Answers0