April 2017
Beginner to intermediate
360 pages
9h 35m
English
When we explore precomputed aggregate data storage, let's focus on the first question posed earlier: how many total views did status updates receive on each day of September?
More generally, we want to store the daily overall view counts in a structure that allows us to easily retrieve the counts for a given range of time. We don't need to store discrete information about every view event that happened; simply knowing how many views occurred per day is sufficient.
Let's create a new daily_status_update_views table that aggregates our analytics observations at just the right granularity:
CREATE TABLE "daily_status_update_views" ( "year" int, "date" timestamp, "total_views" counter, "web_views" ...
Read now
Unlock full access