3 ms·
Writing to mySQL on every page request is generally a "bad idea" unless you aren't getting much traffic (in which case, it's the easiest solution). The scalabl
by stevencorona 15y ago
Writing to mySQL on every page request is generally a "bad idea" unless you aren't getting much traffic (in which case, it's the easiest solution).
The scalable way to build something like this would be to log your raw data to a service like Scribe Server (open sourced by Facebook) or rsyslogd and then aggregating it in a background process. The aggregated data can be stored in mySQL or whatever datastore you prefer.
http://scribeserver.svn.sourceforge.net/ http://scribeserver.svn.sourceforge.net/
http://www.rsyslog.com/ http://www.rsyslog.com/
(Scribe is a bit more complicated to setup and hook into PHP, but is a much better choice for a highly distributed/scalable system)
- petervandijck 15y agohttp://www.google.com/search?q=premature+optimization+is http://www.google.com/search?q=premature+optimization+is
- stevencorona 15y agoI agree completely- most likely OP doesn't need a solution this complex- but it doesn't make any answer any less correct.
- ichilton 15y agoThanks - i'll look into this