Database call for each pageview?


(beatybeaty) #1

I’m trying to find out more about how Piwik works and stores data.

I can’t seem to find docs on exactly how Piwik works on a very technical level. Does it work like this?

  • page is requested from web server
  • embedded Piwki JS file gets called
  • JS file makes a request to a file that ultimately inserts a row into the database
  • database row is used for tracking

If this is the case, it doesn’t sound like it will scale very well on sites that have dozens of requests per second. Can anyone help me understand how Piwik handles high load, especially when it comes to the database side of things? Also, what about redundant database setups? What if the database goes down?

Any help is appreciated.

Thanks,
Jason


(Matthieu Aubry) #2

You are right that Piwik would not work in very high load websites, as it relies on MySQL for scaling and it would hit a limit quickly. Some users have 20M pages per month, tracking more than 1,000 websites.

To help with the scaling issue, we plan to implement delayed bulk load of stats, see http://dev.piwik.org/trac/ticket/134 for more details