大厂标准架构(Amplitude/Mixpanel): - analytics_event_log: 事件流水(append-only,每条事件一行) - analytics_device_profile: 设备快照(每台设备一行,upsert 更新) 设备分布查询从 O(events) 降为 O(devices): - SELECT COUNT(*), device_brand FROM analytics_device_profile GROUP BY device_brand 不再需要 COUNT(DISTINCT install_id) 扫描全量事件表 ON CONFLICT (install_id) DO UPDATE: - COALESCE 保留已有字段(不被 NULL 覆盖) - last_seen_at 每次上报更新 - event_count 累加(可用于活跃度分析) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .claude | ||
| api-gateway | ||
| infrastructure | ||
| mpc-system | ||
| scripts | ||
| services | ||
| .env.windows | ||
| docker-compose.windows.yml | ||