The Problem We Were Actually Solving

We assumed Postgres could keep up with event ordering. We were wrong. The real performance killer wasnt the database—it was our event configuration model.

Veltrix tracked three things per event: user_id, event_type, and timestamp. We used a GIN index on (user_id, event_type) and relied on Postgres default synchronous commit. At 300k events/sec, the index became a hotspot. WAL writes saturated the disk. P99 latency jumped to 1.2s during spikes. Engineers blamed Kafka consumer lag, but the root cause was a 30-line configuration file we never reviewed.

The silent killer wasnt the traffic—it was the default values. We inherited them from an old prototype.

What We Tried First (And Why It Failed)