Z
Z
zvonok13372016-07-04 11:54:54
PHP
zvonok1337, 2016-07-04 11:54:54

How to synchronize data changes between the site and c# application?

Hello!
The question is:
I have the following system for 10,000 concurrent users: A 269c4ce6525848e1a63ca745e0a617aa.png
C# client sends a POST/GET/PUT request to the API when an event occurs. Then the API sends to the server, the server performs its manipulations and returns the API response, and the API returns to the client.
For example, I add some information to the C# text field, click on the button, it carries out the procedure described above, and if everything is OK, then it adds the entered information to the program.
What is the problem?
The website also acts as a client and has all the same features as a C# client. When using the site, the information in the C# client is not updated until a manual update (by pressing a button) or an update every 30 seconds (via a timer, which is not buzzing) occurs, as with a minimum delay (<5-10 seconds) add a new one ( or updated) information in the C# client?
There was an idea to send a long-pull request to the server, but it seemed to me not very efficient (10,000 simultaneous long-pull connections - is that scary?). What can be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
#
#algooptimize #bottize, 2016-07-04
@zvonok1337

There are only a couple of options and their combination is a permanent connection and a non-permanent one.
If there is no new data for a long time, you can tear the permanent one. The concept can change for a long time.
What exactly it will be - a socket, a web socket - is a matter of implementation and additional load.
Why the website is just not clear. Cross origin and browser can access the api at once if they are on different hosts.

E
eRKa, 2016-07-05
@kttotto

You need web sockets. I don’t know about php, but there is a good SignalR library in C #, it is just capable of updating data on the client if there are any changes in the data on the server. It is just a wrapper over web sockets.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question