Kahuho’s work has already been covered on that blog, but he explained the big picture at the Percona’s conference.
Running a Realtime Stats Service on MySQL is worth a read in order to know about clever ways to compute stats in real-time using MySQL.