There's more than one way to do things | |
PerlMonks |
Database vs. tail -fby Coruscate (Sexton) |
on Apr 19, 2003 at 22:58 UTC ( [id://251733]=perlquestion: print w/replies, xml ) | Need Help?? |
Coruscate has asked for the wisdom of the Perl Monks concerning the following question: I am currently in a situation where multiple clients need to make data available to one server application. Both the server and client are running on the same machine, so this makes it very easy to handle. My question is: which way is better? I've thought of having the clients append to a flat text file, while the server uses tail -f to get at the data. My second thought was using a database. Here is example structure of my thoughts. First, the database method:
Then let's take a look at the flat text file way of getting this done:
So out of these two methods, which one strikes you as being more efficient? Or can you think of a different method altogether that beats the pants of both of these? As well, is there any flaw in my logic of the file locking for the flat file method? Will `tail` still be capable of reading the appended data, even if I take an exclusive lock on the file while appending is done? Thanks :) If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.
Back to
Seekers of Perl Wisdom
|
|