473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Constantly updated list

Hi I need to create a list that is updated whenever a change occurs in
the database.
I first used Ajax to poll a part of the page and query the database
every 5-10 seconds, downloading the data every time... however as
someone pointed out.. polling is bad practice and uses a lot of
bandwidth.

I've given it some thought and I'm wondering whether I can use polling
more efficiently?

For example:
I have a function that querys the database and returns my results in a
structured array - I assign this as $current_list.
Then I poll a page that querys the database every 5-10 seconds and
compares $current_list against $new_list ... if there is a difference,
then it refreshes the $current_list array :)

As I'm refreshing the array on the server side and only downloading
when there is a change this should be much more bandwidth friendly
right?

Is there any point in only updating the part of the array which has
changed it's fairly small data (The array will have a max of ten
records (sub arrays) with 6 fields in each)

Many Thanks

Sep 16 '07 #1
2 1354
FrobinRobin wrote:
Hi I need to create a list that is updated whenever a change occurs in
the database.
I first used Ajax to poll a part of the page and query the database
every 5-10 seconds, downloading the data every time... however as
someone pointed out.. polling is bad practice and uses a lot of
bandwidth.

I've given it some thought and I'm wondering whether I can use polling
more efficiently?

For example:
I have a function that querys the database and returns my results in a
structured array - I assign this as $current_list.
Then I poll a page that querys the database every 5-10 seconds and
compares $current_list against $new_list ... if there is a difference,
then it refreshes the $current_list array :)

As I'm refreshing the array on the server side and only downloading
when there is a change this should be much more bandwidth friendly
right?

Is there any point in only updating the part of the array which has
changed it's fairly small data (The array will have a max of ten
records (sub arrays) with 6 fields in each)

Many Thanks
Downloading one row vs. 10 rows is probably an insignificant amount of
overhead compared to the polling involved (unless your database is
updated a lot).

Personally, I'd be looking at a different way of doing it - for
instance, a java applet. HTTP just isn't a good match for this type of
operation.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 16 '07 #2
C.
On 16 Sep, 18:48, Jerry Stuckle <jstuck...@attglobal.netwrote:
FrobinRobin wrote:
Hi I need to create a list that is updated whenever a change occurs in
the database.
I first used Ajax to poll a part of the page and query the database
every 5-10 seconds, downloading the data every time... however as
someone pointed out.. polling is bad practice and uses a lot of
bandwidth.
I've given it some thought and I'm wondering whether I can use polling
more efficiently?
For example:
I have a function that querys the database and returns my results in a
structured array - I assign this as $current_list.
Then I poll a page that querys the database every 5-10 seconds and
compares $current_list against $new_list ... if there is a difference,
then it refreshes the $current_list array :)
As I'm refreshing the array on the server side and only downloading
when there is a change this should be much more bandwidth friendly
right?
Is there any point in only updating the part of the array which has
changed it's fairly small data (The array will have a max of ten
records (sub arrays) with 6 fields in each)
Many Thanks

Downloading one row vs. 10 rows is probably an insignificant amount of
overhead compared to the polling involved (unless your database is
updated a lot).

Personally, I'd be looking at a different way of doing it - for
instance, a java applet. HTTP just isn't a good match for this type of
operation.
Pushing from server to client will break in a lot of scenarios. If you
control the infrastructure in between then you'll know if it will
work.

It may be cheaper to measure the change from a different direction
(e.g. mod time on the database file, triggers on the tables...)

C.

Sep 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rick Morrison | last post by:
Would there be any way to add a method to all dict objects that operated like the .update() method, but also returned a reference to the updated dict? ..update() is clumsy to use inside of list...
1
by: Eric Robishaw | last post by:
In VS.net 2003, my recent files list will not update the Date. If I open a project from the list, modify it and close... the next time I load VS.net, the project shows the same old date. It...
0
by: Leif Neland | last post by:
I'm logging mail to a database, and using php to make queries. The mail is coming in constantly, so the table is being added to, in batches of up to 30 mails. I have around 600k records. The...
1
by: eal1 | last post by:
Does anyone know how to have Access put the "last updated" date on a report? I have a table of our university's athletic events, grouped by each sport per page. I'm trying to get the report to...
2
by: Spam Catcher | last post by:
Hi All, I want to bind a datagridview or ListView to a List that is constantly being updated (items are added/removed all the time). Any ideas what the best way is to do this? I tried binding...
1
by: MLH | last post by:
I can't find a list of events that are constantly monitored on background forms in A97. What I'm wondering is if there are events that are NOT being scanned for on forms running in the background....
1
by: de_ja | last post by:
HI, Thanks for assisting me with my previous query. I have almost completed my access database. And now in the process of optimising it. When I first developped the database I had...
4
by: Andy B | last post by:
I need to make a program that stays in the xp/vista system tray. I have to constantly search xml files to make sure the program stays updated with the newest xml data. What is the least CPU...
18
by: navyjax2 | last post by:
What if your event handler has to be nonstatic?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.