mysql - What's the most efficient architecture for this system? (push or pull) -


all s/w windows based, coded in delphi.

some guys submit data, send tcp database server running mysql.

some other guys add pass/fail data , update database.

and third group looking @ reports.

now, first group can see history of submitted. when second group adds pass/fail, update history. options seem

  1. blindly refresh history regularly (in delphi, display on db grid close open query), seems inefficient.
  2. ask database server regularly if changed in last x minutes.
  3. never poll database server, instead letting inform user's app when changes.

1 seems inefficient. 2 seems better. 3 reduces tcp traffic, isn't much. anyway, few bytes each 2. however, has disadvantage both sides both tcp client , server.

similarly, if member of third group viewing report , member of either of first 2 groups updates data, wish reflect in report. best way this?

i guess there 2 things consider. importantly, reduce network traffic and, less important, make code simpler.

i sure common pattern, new kind of thing, welcome advice. in advance.


[update] close voters, have googled & can't find answer. hoping beneft of experience. can me reword acceptable? or maybe give utl me? thanks

short answer: use notifications (option 3).

long answer: use case middle layer propagates changes using message-oriented middleware. decouples messaging logic database metadata (triggers / stored procedures), can use peer-to-peer , publish/subscribe communication patterns, , more.

i have blogged two-part article at

the article firebird suggested solutions can applied application / database.

in scenarios, clients can use middleware message broker send messages system if database or delphi part down. messages queued in broker until other parts of system online. advantage if there many clients , update installations or maintenance windows required.

similarly, if member of third group viewing report , member of either of first 2 groups updates data, wish reflect in report. best way this?

if real requirement (reports immutable 'snapshot' of data, maybe mean view needs updated while beeing watched, similar stock ticker) easy implement - client needs 'subscribe' information channel announces relevant data changes. can solved flexible , resource-saving existing message broker features message selectors , destination wildcards. (note author of delphi , free pascal client libraries open source message brokers.)


related questions:


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -