Question

I have a simple problem which I need to solve. The solution might not be that simple, though...
I have a web application at example.com and multiple users are using it at the same time. At some moment, 10 of those users are all looking at the Countries page which lists about 200+ countries. This page divides the lists in sections of 20 countries and some users might have filters to e.g. show only all countries starting with the letter N.
Then one user decides to rename Netherlands to Holland, and I want all other users to see this change (almost) immediately.

Of all those users, some might have been looking at a different set of countries. The Netherlands would not be visible, so they should not be updated. One user might be looking at all countries starting with N so he needs to see that Netherlands disappears. One might be looking at the first 20 countries and Netherlands is at place 50 and Holland at place 32, so he doesn't see either of them, so no update. And one user looks at all countries starting with H and he needs to get an update since Holland is added. Finally, one user looks at all countries that use Euro's as currency and he should see an update where Netherlands changes into Holland.
Basically, just a lot of updates based on the actions of a single user. Considering the fact that I might have up to 2.000 users and the Countries table being very popular, I have to be careful about performance.

So, what would be the best approach for this? Since I use the DevExpress ASP.NET components, there might be something very useful for this in these components. Unfortunately, I'm still a new user of those components.

Était-ce utile?

La solution

The solution you are looking for resides with the Server-Push technologies.

The .Net framework provides a solution for two way communication via the WCF Callbacks. More information here.

The signalR framework provides pushing data to the Client Side, so it is better for MVC like applications and not so much on DevExpress Tools that do most of the databinding on the ServerSide. Info on signalR can be found here.

DevExpress sugests a solution with timers (PostBacks after a certain time has passed).

On a general note html 5 provides the WebSocket functionality, which is essentially what all the other options use on a part. Frameworks like the above, build on the technologies but also provide walk-arounds by using timers and such.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top