Answered by:
Different Applications Using Same Database for Signalr backplane

Question
-
User567636359 posted
Hi,
We have three different applications that are all using the Same Database for the Signalr backplane feature.
I have seen several times Duplicate key errors and also many times the connection goes stale.
Trying to find any documentation that specifies that we cannot use a single Database that hosts three different singalr back-end hosts.
Any help is appreciated.
thanks
sv
Monday, September 18, 2017 7:50 PM
Answers
-
User567636359 posted
Found out few solutions for the issue:
if you have redis available use that its faster than sql.
Else increase your table count that will help reduce collisions
https://msdn.microsoft.com/en-us/library/microsoft.aspnet.signalr.sqlscaleoutconfiguration.tablecount(v=vs.118).aspx
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, September 21, 2017 1:05 AM
All replies
-
User1771544211 posted
Hi sibyvarghese,
Trying to find any documentation that specifies that we cannot use a single Database that hosts three different singalr back-end hostsBased on my experience, you can use locking to fix your problem.
In multi-user environment it’s possible that multiple users can update the same record at the same time causing confusion between users. This issue is termed as concurrency. Concurrency problems can be solved by implementing proper “Locking strategy”. Locks prevent action on a resource to be performed when some other resource is already performing some action on it.
The following article shows how to use the optimistic lock to solve the concurrency, please take it as reference.
https://www.codeproject.com/Articles/114262/ways-of-doing-locking-in-NET-Pessimistic-and-opt
And you can learn more about the SQL Server Transaction Locking and Row Versioning Guide in the following link.
https://msdn.microsoft.com/en-us/library/jj856598(v=sql.120).aspx
Best Regards,
Jean
Tuesday, September 19, 2017 2:08 AM -
User567636359 posted
Well thanks for reply..but locking isn't what I am looking for ..this is specifically for signalr.
I need some documentation that show we can or cannot use the same db between seperate signalr instances.
Hopefully an expert can help
Tuesday, September 19, 2017 11:38 AM -
User1771544211 posted
Hi sibyvarghese,
I need some documentation that show we can or cannot use the same db between seperate signalr instances.Based on my experience, you can use the same db between separate signalr instances. However, this may lead to concurrency problems. That's why I suggest you to use locking in my previous post.
Best Regards,
Jean
Wednesday, September 20, 2017 7:18 AM -
User567636359 posted
Found out few solutions for the issue:
if you have redis available use that its faster than sql.
Else increase your table count that will help reduce collisions
https://msdn.microsoft.com/en-us/library/microsoft.aspnet.signalr.sqlscaleoutconfiguration.tablecount(v=vs.118).aspx
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, September 21, 2017 1:05 AM