background:
I have 'inherited' a php webapp in my small company and after years of nagging have finally gotten the go to throw away the spaghetti code and start again.
We want to log every action that is made in the system for example:
- user X viewed item Y
- user X updated item Y
- new item Y on city Z
and later provide graphs on different resolutions ( day, month , year ) of the actions done in the system.
On the previous version we have a table with 20,000,000 of records since 2005 so this would give you an idea of the ammount of data we already have and this is only for one of many statistics.
actual question:
What recomendations you have on building a near to realtime system to create this statistics?
notes:
- Graphing is already covered via google's visualization api
- Im not adversed of using any NoSql databases or messaging servers, crons or whatever that gets the job done, but would prefer mysql/php solution
- My current train of thought is automatically create a table for each statistic I want to save, and create several aggregation tables ( by month , by day , by year ) to cache the results.
- I know is a broad question but any suggestions are welcomed