|
Posted by David T. Ashley on 11/16/06 16:46
"rich" <rbrooks@gmail.com> wrote in message
news:1163690515.482621.145940@b28g2000cwb.googlegroups.com...
> My question is is there a way to make a connection to mysql that
> multiple instances of an object will use together? I'm under the
> impression that something like a singleton would only live on a per
> instance basis, or am I incorrect?
We'd all need to know a little bit more about your application, and whether
the updates have to be done right away.
The obvious solution that comes to mind is just to have each PHP web process
append to a file, and have a separate daemon that flushes the file to the
database. Unix file semantics guarantee that there is a way to do this with
guaranteed results (for example, the daemon mv's the file then operates on
it ... this guarantees that any append operations either occur before or
after the mv but won't collide with it).
You could have the daemon just look at the file from time to time (once a
second?), or you could use a more fancy triggering mechanism.
They key design factor seems to be whether the database updates have to
complete by the time the PHP web script ends ...
Dave.
Navigation:
[Reply to this message]
|