phase 6
This commit is contained in:
@@ -106,14 +106,14 @@ The `CollectController` currently does synchronous DB writes. This won't scale u
|
||||
|
||||
Raw event tables grow fast. Pre-aggregate data for fast dashboard loads.
|
||||
|
||||
- [ ] Create `daily_aggregates` table (migration + model):
|
||||
- [x] Create `daily_aggregates` table (migration + model):
|
||||
- `website_id`, `date`, `visitors`, `sessions`, `page_views`, `bounce_count`, `total_duration`
|
||||
- [ ] Create `page_daily_aggregates` table:
|
||||
- [x] Create `page_daily_aggregates` table:
|
||||
- `website_id`, `date`, `path`, `views`, `unique_views`, `total_time_on_page`, `bounces`
|
||||
- [ ] Create a scheduled Artisan command (`analytics:aggregate`) that rolls up yesterday's raw data into aggregate tables — run daily via `schedule:run`
|
||||
- [ ] Refactor dashboard and report queries to read from aggregates for past days, and query raw tables only for "today"
|
||||
- [ ] Add database indexes review — ensure all date-range + website_id queries are covered
|
||||
- [ ] Consider adding a `data_retention_days` setting per website and a cleanup command to purge old raw rows
|
||||
- [x] Create a scheduled Artisan command (`analytics:aggregate`) that rolls up yesterday's raw data into aggregate tables — run daily via `schedule:run`
|
||||
- [x] Refactor dashboard and report queries to read from aggregates for past days, and query raw tables only for "today"
|
||||
- [x] Add database indexes review — ensure all date-range + website_id queries are covered
|
||||
- [x] Add `data_retention_days` setting per website (stored in `settings` JSON) and a cleanup command (`analytics:purge`) to purge old raw rows
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user