I have a warehouse management app that I have written that handles batching of orders for batch picking, scanning of items for packing and accuracy. Part of this app is a Dash or control panel that the different managers in the warehouse work out of. It shows who's picking, packing, who's available, how many orders are available to be batched and a BUNCH of other details and controls. Right now i have an ajax call that checks a time stamp that runs every 30 seconds or so to see if the page should be updated (a change made on another managers workstation). A manager does something that should be shown on all other workstations that are viewing the dash. Maybe they batched some orders and pickers that were available are no longer available. Right now when the change is made i update a timestamp saved in a database. On the html page the timestamp that was in the db at last page load is saved in a hidden div. The javascript takes that timestamp and checks the database at an interval if its different the page updates.Its a bit more complicated than this as sections of the page get changed not the whole thing but the description sums up the process.This works but i don't like it. It requires a database hit from each workstation every 30 seconds. Seems overly complex. I am looking for some thoughts on how I might push a change as it occurs and minimize or eliminate some of the database interactions.Thoughts?
Pushing changes to an open web page
javascript;web applications;ajax
I know that yours sounds as it is not the best solution, but I do agree that is is the simplest that could be achieved with the current common technology resources available.One of the approaches to make that more efficient and less server-heavy is the use of cache. Your cache could be updated directly when your manager makes changes AND in the database, so that the rest of the clients always (or most of the time) get their response from the cache.Someone mentioned the use of web sockets and that's another great idea.Also, I would make the application very rich in UI so all of these changes only mean a simple query to the backend and all of the data/UI/screen computation is done on the users client machine. 