Recording aggregate analytics observations
When we explore precomputed aggregate data storage, let's focus on the first question posed above: 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" counter, "mobile_views" ...
Get Learning Apache Cassandra now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.