Simplified case:
Storage
- Users click on a link
- link_clicks +1 for each click
- Super user sets a multiplier parameter for each click
- link_reward (+1 * param) for each click
- User ID is also recorded for each click
Retrieval
- Queries must be done on a specific date range (e.g., "How many click between Oct 10 and Oct 23 for User ID = 4")
- Most queries will be done, however, on the sum of all dates for a given user
Assuming the table gets massive, both kinds of queries will get very slow right?
How does one handle this? Simultaneously store in one detailed table (a row per click per user per link) and in one summary table (a row per user per link)? I've heard of "rolling up" the data but I don't know what that means.
Technologies used: MySQL, PHP (and Javascript)