Recipe

QuestDB Primer

QuestDB is a high-performance time-series database built for ingest throughput and fast SQL queries over timestamped data. This primer walks you through the essentials so you can wire QuestDB into your Meridian pipeline in minutes, not hours. We cover schema design, ingestion patterns, and query tuning specifically aimed at agentic workloads where event volume is bursty and shape-drifty.

1. Designing the table

Every QuestDB table needs a designated timestamp column and a partition strategy. For event streams, partition by day; for high-velocity telemetry, partition by hour. Choose SYMBOL for low-cardinality string columns to get free indexing and dictionary compression.

CREATE TABLE events (
  ts TIMESTAMP,
  agent_id SYMBOL CAPACITY 1024,
  event_type SYMBOL,
  latency_ms DOUBLE,
  payload STRING
) TIMESTAMP(ts) PARTITION BY DAY WAL;

2. Ingesting at scale

Use the InfluxDB Line Protocol over TCP on port 9009 for the fastest ingestion path. The protocol is fire-and-forget, batched on the server side, and easily handles millions of rows per second on modest hardware. For transactional writes, fall back to PostgreSQL wire on port 8812.

3. Querying with SAMPLE BY

QuestDB extends standard SQL with time-series operators like SAMPLE BY, LATEST ON, and ASOF JOIN. These are the workhorses of agent observability. Bucket events into one-minute windows, grab the last known state per agent, or correlate two streams without blowing up your query plan.

Next up: wire your Meridian agent runs into this table and explore them with the built-in QuestDB web console at port 9000.