Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
    
This requires both your database (pubsub) and your web server (websockets) to push data. Your technology stack may need changing –  Raynos Aug 3 '11 at 17:03
    
This might help you: ape-project.org/ajax-push.html –  Robert Harvey Aug 3 '11 at 21:21
    
Read sections 11.5 and 11.6 in Exploring Lift –  Joseph Shraibman Aug 5 '11 at 23:32
    
I don't see why this is complex. It seems like the simplest possible solution. Other solutions may decrease the server load, but the implementation will be more complex. How many workstations are there? –  kevin cline Aug 6 '11 at 4:49
1  
Seems to me that a web interface isn't really the best solution for something like this. Kinda like using a screw driver as a hammer. If you set up a client/server application using a language such as Java you'd probably find your results to be better. –  Kenneth Aug 6 '11 at 17:00
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.