How to reduce SQL Server remote workloads?

I want to create a C # application with client and server sides. It will work on the local network. Client parties should check for updates on the remote SQL Server. Suppose we set the refresh interval to 2 seconds. If I have 20 client applications, they will send a query to the remote SQL Server every 2 seconds, and it will load the server quite a lot. Now I want to know if there is a way to reduce the load on the server or is it just a way to check for updates?

+7
source share
1 answer

From my point of view, there is no need to allow clients to directly connect Serial DB. There should be one more level that will connect only to the server and cache update information. Your customers should connect to this additional information and work with cached information.

UPDATE As I understand it, the problem arises because all your clients pinged your database server every two seconds. The solution to this problem is to create a special module that will have access only to the database server and requests it for updating. For example, every two seconds. If the update is ready, it should be able to retrieve it from the database and store it. This is what I meant by an extra level.

Now back to your customers. They should be able to communicate with this module and receive information about the finished update from it (this information is cached and, therefore, very quickly receive it). Also, you do not need to ping the server with every client request). If the update is ready, select it on the client side and do the work on the client side.

As for the connection between this additional layer and the customers. Since you work with .NET, I would suggest you take a look at WCF, which, from my point of view, is becoming the standard approach to implementing interprocess communication in .NET. The network has a lot of information about this, I will soon send links.

Here is my favorite WCF book:

Programming WCF Services

MSDN Record:

Windows Communication Foundation

+14
source

All Articles