Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>RE: Config data</strong> It might be a good idea to keep config data in the database to make it easier to edit it and keep track of the changes but then wright it out to a config file for the actual program to read. </p> <ul> <li><p>Why should apache have to know anything about your database information to be able to get to its configuration?</p></li> <li><p>Why should your FTP server stop working when the database is down?</p></li> </ul> <p><strong>RE: Application logs</strong></p> <p>As stated earlier, a database can make log analyzing a lot easier, but I urge you to consider the log-to-file-and-batch-import-later pattern.</p> <p><strong><em>Performance issues</em></strong></p> <p>Databases are great for getting random bits of data out and putting random bits of data in. Log data mostly is not written randomly but in a continues stream of data that is perfect for putting in a file one line after an other. You can't beat the performance of a flat file when it comes to writing the data. There's not a lot of things that can break with a flat file either. This also lets the database concentrate on doing the actual business work.</p> <p>Then later on you can collect all the logged data from the file, parse it, do any required post processing (like looking up host names from IP addresses) and put it into a database table. You do this as often as you find necessary. For my website I really don't need to be able to view the visitor stats change from one minute to the other so I run the log batch at night. If you need up to date info you can just as well run the batch import every 60 seconds, but this will still be better than doing one extra INSERT statement for every actual business transaction (depending on how much you log, of course).</p> <p><strong><em>Security</em></strong></p> <ul> <li><p>How do you log a failed database connection if the database is your log engine?</p></li> <li><p>How do you investigate why a system crashed if the database went down early during the events involved in the crash?</p></li> </ul> <p>So I think you should consider when you need the log data in the database and why you need it in there.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload