
fastpageviews
python library for Google Appengine, which provides fast server-side pageview counting, using memcache backed by a DB with periodic writebacks.
live demo on http://fastpageviews.appspot.com/
Unlike precise solutions e.g. sharded counters, this should scale better because it radically reduces writeback traffic. I haven't run benchmarks, but AFAICT the last 30 years of database research has pretty much concluded that write-ahead logging wins-- but even WAL struggles to keep up with per-pageview traffic, particularly when you're tracking multiple elements on a page, resulting in multiple counter-increments per pageview. The other winning strategies I've seen are: (a) offer non-realtime stats, which allows more efficient logging-based solutions, or (b) use a faster database than the app you're tracking. Arguably, Google Analytics does both.
Unlike remote hitcounters (e.g. hitbox), server-side solutions are lower latency (incl. fewer DNS calls) and make it easier to incorporate the data into your app (e.g. graphs) and support more counters per app. They're not for everyone.
TODOs:
- aggregate reporting, e.g. tagging "pagename" with other tags and aggregate (e.g. sum) by tag.
- reporting traffic over time, per pagename but also by tags
- implement function for flushing the cache back to the DB (gets tricks for large numbers of objects)
- better memory handling e.g. for large numbers of objects (e.g. paging out rarely seen objects)
Project Information
- License: GNU Lesser GPL
- 4 stars
- svn-based source control