Storing Log DataSolution OverviewSchema DesignOperationsInserting a log recordBulk insertsFinding all events for a particular pageAside: managing index sizeFinding all the events for a particular dateFinding all events for a particular host/dateRules of index designCounting requests by day and pageSharding ConcernsLimitationsOption 1: Shard by timeOption 2: Shard by a semi-random keyOption 3: Shard by an evenly distributed key in the data setOption 4: Shard by combining a natural and synthetic keyTest with your own dataManaging Event Data GrowthCapped collectionsTTL collectionsMultiple collections, single databaseMultiple databasesPre-Aggregated ReportsSolution OverviewSchema DesignOne document per page per day, flat documentsOne document per page per day, hierarchical documentsSeparate documents by granularity levelOperationsLog an eventPre-allocateRetrieving data for a real-time chartGet data for a historical chartSharding ConcernsHierarchical AggregationSolution OverviewSchema DesignMapReduceOperationsCreating hourly views from event collectionsDeriving day-level dataWeekly and monthly aggregationRefactor map functionsSharding Concerns