Push or Pull for a real-time automation server?

We are currently developing a server on which the client requests interest in changes in specific data elements and when the data changes the server, it returns data to the client. There is vigorous debate about whether it would be better if the client polled this data.

What is considered the ideal method in terms of performance, scalability and network load, data transfer in almost real time?

Update: Here is a Link that provides some food for thought regarding user interface updates.

+4
source share
3 answers

There is probably no perfect method for each situation, but the jerk is usually better and is used more often. This allows you to optimize caching and data transfer, which helps increase productivity and scalability, as well as reduces network traffic, avoiding client requests and empty responses. This can be an important advantage so that the server runs at its own pace and delivers data to clients when it is ready.

Industry standards - such as OPC, GID - support both. The server pushes updates to signed clients, but the client can retrieve some rarely used data without worrying about the subscription.

+3
source

As long as the client initiates the connection (to receive the transmitted firewalls and problems with NAT), everything is in order.

If you need to send several different types of data, you might want the client to indicate which type it wants, but this is only needed once per connection. You can then force the server to continue sending updates as they become available.

There would be less network traffic for the server to send updates without constantly asking the client for updates.

+1
source

What do you have on the client side? Many firewalls allow outgoing requests, but block incoming requests. In other words, craving may be your only option if you go over the Internet, if you don't send emails.

0
source

Source: https://habr.com/ru/post/1276663/


All Articles