michaelslamet Posted December 15, 2013 Posted December 15, 2013 Greeting Friends, I need (an) advice(s) again. My script run by many users on a network drive. It need access (read and write) to a "log" file. I need to decide should I use a MySQL database for this log or use a text (INI) file. If the text (INI) file used, it will placed on the network drive that every user have a write permission. Few "facts": 1. This log file will have around thousand of records/lines, maybe no more then 10,000 records because I will have my script keep only log for the last 7 days. 2. My script will only need to read and write the last few lines of the file. 3. My script will read and write the log files many many times during execution. I need my script to write to the log file in the real time (not only write when the script exit). Honestly to say, I prefer to use a text file, because I dont need to alter/create a database on the server and I dont need to put a MySQL write credential on the script, but if using a text file is not recommended, I'm going to use the MySQL database. So, which one should I use? Thanks a bunch in advance
Rogue5099 Posted December 15, 2013 Posted December 15, 2013 The data is easily obtained either INI or SQL. I'm not too familiar with SQL but with the INI you can create/edit by just one line. With security being a problem INI wouldn't be the best way to store the information cause it is easily read. I only say INI because I know more about reading and writing to it than I do SQL. Other options to at least keep the honest people out is to hide the INI file. Even when hidden you can read/write to it. My projects: Inventory / Mp3 Inventory, Computer Stats
AZJIO Posted December 15, 2013 Posted December 15, 2013 INI-file is completely rewritten every time you change at least one parameter. SQL writes data to the file pointer, ie rewrites the only sector in the file. My other projects or all
michaelslamet Posted December 15, 2013 Author Posted December 15, 2013 @AZJIO: you mean, SQL is much much faster then text (INI) file?
michaelslamet Posted December 15, 2013 Author Posted December 15, 2013 (edited) @AZJIO: what if using SQL, but actually the file pointer is moving (not stay) while the script running (because it's actively searching for another record/table/database) @Rogue5099: the log file content will be no secret. Thanks for the idea to let the file in a hidden attribute. Edited December 15, 2013 by michaelslamet
AZJIO Posted December 15, 2013 Posted December 15, 2013 @michaelslametmaybe no more then 10,000 records becauseLoad on the hard drive will be reduced to 10,000 times. actively searchingmoves the head of the hard disk to the specified position. It is always shorter than rewrite the entire file. My other projects or all
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now