timothepearce/laravel-time-series
Store and query time-series data in Laravel with Eloquent. Aggregate metrics by minute, hour, day or month, calculate rolling averages and sums, and keep historical stats in MySQL, PostgreSQL or SQLite without extra infrastructure.
Architecture fit
series-style table plus an entries-style table, and Eloquent models with query/aggregation helpers on top. That is the same shape as our existing domain models, so it slots into a monolith or a modular Laravel app without introducing a new runtime, daemon, or external datastore.Integration feasibility
composer require, publish migrations/config, run migrations, define series, write points, query. A Laravel developer can produce a working spike in under a day.v1.0.0-beta-9, meaning the public API has never been declared stable. We must verify against our actual target (Laravel 10/11, PHP 8.2/8.3, Carbon 2.x/3.x, MySQL 8 / Postgres 15) before committing.Technical risk
GROUP BY, which are not sargable against a plain timestamp index. Cost grows with range width, not just row count. Wide date ranges and short intervals are the worst case.Key questions
(series, timestamp) to make writes idempotent under retry?Stack fit
MetricsRepository/service class so controllers, dashboards, and jobs never touch package classes directly.Migration path
(series_id, created_at/timestamp) if not already present, and create series via seeders or an admin surface.Compatibility
doctrine/dbal presence if column changes are needed, and DB-specific date functions.1.0.0-beta9 exact or a narrow range) — never * or an open ^ on a beta.Sequencing
Maintenance
Support
Scaling
(series_id, timestamp); (2) cache with sane TTLs and per-tenant/user keying; (3) pre-aggregated rollup tables populated by scheduled jobs for the ranges dashboards actually request; (4) table partitioning by time plus a retention/pruning job; (5) read replica for reporting queries.Failure modes
Ramp-up
How can I help you explore Laravel packages today?