Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Default/Serverless/Classic settings in Azure SignalR?

I have set up the Azure SignalR Service for REST API. There are three modes under settings: Default, Serverless, Classic. I can't find any information about what each of these items sets. The only one thing I got so far, that if I use Azure SignalR for Azure Functions or REST APIs it's preferable to use Serverless option.

From documentation:

Change the Service Mode setting to Serverless only if you are using Azure SignalR Service through Azure Functions binding or REST API. Leave it in Classic or Default otherwise.

Serverless mode is not supported for ASP.NET SignalR applications. Always use Default or Classic for the Azure SignalR Service instance.

Could you please help me to find what each of these options sets?

Azure SignalR Settings

like image 759
Anna Avatar asked Nov 04 '19 23:11

Anna


People also ask

What is SignalR serverless?

Photo by Microsoft Documentation: SignalR Serverless Mode. In this mode the server application doesn't have a fixed connection to SignalR and the clients. Instead, a client can reach a different backend (or function instance) on every request. Communication is done through a rest api or with websockets.

What is SignalR service in Azure?

Azure SignalR Service simplifies the process of adding real-time web functionality to applications over HTTP. This real-time functionality allows the service to push content updates to connected clients, such as a single page web or mobile application.

Is Azure SignalR expensive?

It costs about $2/day per 1000 concurrent SignalR service connections. Generally if you have 1 million users, they are not connected at once. For Functions... it costs one execution for a function to send a message via SignalR Service, no matter how many devices are connected.


1 Answers

According to the docs on Github, it determines whether a hub server connected to the SignalR service is needed or allowed:

Default mode requires hub server. When there is no server connection available for the hub, the client tries to connect to this hub fails.

Serverless mode does NOT allow any server connection, i.e. it will reject all server connections, all clients must in serverless mode.

Classic mode is a mixed status. When a hub has server connection, the new client will be routed to hub server, if not, client will enter serverless mode.

Because there isn't a hub server under serverless mode, the things you can do are limited to sending messages to specific clients or broadcast to all clients from a connected client. Also, as there is no hub, messages from clients to SignalR service will be sent over HTTP instead of Websockets, which may have performance concerns as detailed here.

like image 194
scharnyw Avatar answered Oct 21 '22 03:10

scharnyw