SignalR backplane and databaseinput? - database

We have a load balanced webserver setup and we therefore want to use SignalR for client/server communication with a SignalR backplane.
How can we make sure that only one server writes to the database when a client sends something to the server? The backplane will re-route the message to all servers, but not all servers can write the same thing to the DB!
Any techniques/suggestions for how I can both use the SignalR backplane and only write to DB from one server?
In my ideal world I would receive the message on one server, store message to DB and then put a message (maybe not the same as the incoming message) on to the backplane.

The SignalR backplane only forwards messages sent from the server to client to all servers. This is done so SignalR can ensure messages will get to their intended client(s) even if they are connected to another server.
When a SignalR client invokes a Hub method, the Hub method is only invoked on one server even if there are multiple SignalR servers behind a load balancer communicating via a backplane.

Related

SQLserver don't send notifications with service broker

I want to get my application notified if there is any change in my sql server db and I'm using Table dependency to get them. I'm working with a DB that I didn't created (it's sql server 2008R2) and it don't send the messages generated by the service broker, but in the same connection and with a different db generated by me and the same structure of table it sends the service broker messages to my application. Is there anything I need to change to allow SQLserver to send the messages?

Websocket connection through front-end or back-end

am developing a single page for monitoring purpose , some of data in this page come through a websocket as a realtime monitoring , and other data fetched from the database as a historical report .
My Question :
Should i establish the websocket connection in the backend and then send the data to the connected client OR just connect to the websocket server in client side .
Note:
- no need to save the messages come from the webscoket server.
Please i need details .
Thanks

Re establishing clients connection with WCF service

I have a WPF application which communicates with a WCF service which provides data that is updated by WPF application on its UI on continues basis. The Service is hosted on netTCP. Now, if for some reason the WCF app loses its LAN connection and after a few seconds the connection is established again, the WPF app is not able to resume its connection with the service.
Any help is welcomed.
You could make a socket on the WPF client, which will accept a connection from the service, then if the service is back online again it sends a data packet to everyone in the collection currently connected, then if the client recieves a packet it requests a connection with the service again, which will "resume" the connection

SignalR performance drops when SQL Server Service Broker is turned on

I am trying to setup SignalR for use in a load balanced environment with two web servers behind a load balancer and a separate database server.
I am using the SQL Server Backplane. As recommended in the official documentation, I at first turned on the Service Broker for the database. I observed that with the Service broker turned on Messages take much longer to get pushed from server to client. Why would this be the case ?

SSO handshake with Active directory

I've done a small TCP/IP server which acts quite like an ftp server.
On the client side, I'm using an API to connect and to exchange data against the server.
This server will be on an active-directory ecosystem, so the client.
What kind of API should I use to implement a SSO/AD authentication on my server ?
(Everything is written in C)
I've seen that SqlServer is doing this through the Trusted connection term. Perhaps a simplier to do things ?
Should I lead to SSPI exchange loop ?
Yes, you need to init a security context from the client and accept that contect from the server, loop until the security context has been established. If you are concerned about your private, you can encrypt the entire traffic with Kerberos.

Resources