Implementation Of Running Commentary On Any Ongoing Event
Solution 1:
From your explanation this is what came to my mind: XMPP
Hope that will help
Solution 2:
Solution Overview Since you are dealing with live data all the time, there is no need to store it in a database other than for archival purposes. You should have an application scoped buffer that holds the current commentaries for each of the channels (cricket, tennis, football etc.) For displaying it on the page, you should use ajax polling. Don't go for a push model as it can overload the server.
How it works For the buffer I would recommend a queue data structure. Each line of commentary that is created (from an external system or somebody is typing it in) should be added into the queue with a unique line number. The javascript code in the browser always requests for all new lines since the last displayed line, which should be maintained on the browser in a javascript variable or in a hidden variable. As the queue grows big, you can have one or more threads in your server side that reads the oldest entries from the queue and writes them to a database for archival (if you need the feature).
Performance Tuning The size of the queue, the number of archival threads etc. are tuning parameters that needs to be worked out based on the number of users, the available memory and accepted tolerance for missing lines (some clients can miss out some lines at times when the queue is getting archived too fast). If you know these numbers, you can use queuing theory concepts to arrive at the optimum queue size and thread counts.
Post a Comment for "Implementation Of Running Commentary On Any Ongoing Event"