List:General Discussion« Previous MessageNext Message »
From:Yves Goergen Date:March 11 2005 9:38am
Subject:Re: Better option then polling ?
View as plain text  
On 11.03.2005 08:18 (+0100), Michael Gale wrote:
> I have a table in a database that is constantly being updated with new 
> information. I would like to be notified if certain information gets 
> committed.
> 
> Lets say for example the table gets updated every time a login attempt 
> happens regardless if it is successful or not.
> 
> So I want an app to watch the table for incorrect logins and if found to 
> send an e-mail.
> 
> Now there are several problems with this ... first... there could be 
> hundreds of logins so we do not want the same app to spawn multiple 
> processes each notifying the same incorrect login attempt.
> 
> I was thinking about a cron that would run every X minute searching any 
> newly added rows and keeping the last row id in a tmp file.

When you're going to continously poll the database, I'd recommend you to
enable the query cache that is in MySQL since version 4.0. It replies
equal queries with their result from the cache as long as the table has
not changed. So you could drastically reduce the database load for these
queries.

http://dev.mysql.com/doc/mysql/en/query-cache.html

-- 
Yves Goergen "LonelyPixel" <nospam.list@stripped>

Unclassified NewsBoard Forum --> newsboard.unclassified.de
Free (GPL), easy to use and install, secure, innovative! (PHP+MySQL)
Thread
Better option then polling ?Michael Gale11 Mar
  • Re: Better option then polling ?Philippe Poelvoorde11 Mar
  • Re: Better option then polling ?Martijn Tonies11 Mar
  • Re: Better option then polling ?Yves Goergen11 Mar
Re: Better option then polling ?Homam S.A.11 Mar
  • Re: Better option then polling ?Martijn Tonies11 Mar