I’m working on a Intranet application that manipulates data from a SQL server. The application has to support multiple users playing with the same data source / same tables. The application uses a jQuery datatable library fed by a Ajax call to a JSON result action in my MVC Controller and some Ajax links rendered in the table allowing CRUD operations in a form of a modal popup window. When the popup submits the CRUD operation, it closes and calls a refresh on the datatable.
Everything is working wonderfully, however, I want that datatable to update if data is changed by another user (or another browser/tab) without having the refresh the table.
One method would be to poll a Hash from the server every X milliseconds and update if the hash changes, but I dont really like that option as I feel it could get out of hands pretty quickly with the amount of tables to manage.
I would like to know what you guys think of the polling method and if you have an alternative that would be more fluid, cleaner or simply a better practice for X reasons.
Thanks a lot!
The alternative to polling is pushing which is far more efficient. Checkout
SignalR. And here’s an introductory blog post.