Add parallel event ingestion to Tinybird alongside existing Postgres/ClickHouse flow. Events are sent to both systems simultaneously via EventBatchingManager. - Add Tinybird client setup and ingest endpoint (zod-bird) - Add event mapping and send utilities with retry/error handling - Add Tinybird datasources and materialized views - Modify EventBatchingManager to dual-write to SQS + Tinybird - Route track events through batching manager Tinybird will silently skip if not configured (TINYBIRD_URL/TINYBIRD_TOKEN).
21 lines
586 B
Plaintext
21 lines
586 B
Plaintext
DESCRIPTION >
|
|
Materializes events into hourly aggregates with native JSON properties.
|
|
Allows multi-property GROUP BY via properties.field syntax.
|
|
|
|
NODE materialize
|
|
SQL >
|
|
SELECT
|
|
org_id,
|
|
env,
|
|
customer_id,
|
|
event_name,
|
|
toStartOfHour(timestamp) as hour,
|
|
CAST(coalesce(properties, '{}') AS JSON) as properties,
|
|
sum(toFloat64(coalesce(value, 1))) as total_value,
|
|
count() as event_count
|
|
FROM events
|
|
GROUP BY org_id, env, customer_id, event_name, hour, properties
|
|
|
|
TYPE materialized
|
|
DATASOURCE events_hourly_mv
|