Rebuilding Postgres Metrics on Self-Hosted VictoriaMetrics with Zero Downtime
7 hours ago
- #VictoriaMetrics
- #PostgreSQL
- #observability
- Xata migrated PostgreSQL branch metrics from a centralized observability vendor to a self-hosted, per-cell VictoriaMetrics stack to improve scalability, performance, and cost efficiency.
- The new architecture eliminates cross-cell dependencies, with each cell running its own VictoriaMetrics components, reducing blast radius and improving query latency.
- Migration was done incrementally over six weeks with zero user-visible downtime, using feature flags, side-by-side comparisons, and automated routing based on retention windows.
- Frontend optimizations included batching chart queries into a single request, making the console snappier and reducing backend load.
- The new stack uses standard PromQL and off-the-shelf clients, simplifying code and maintenance compared to the previous proprietary vendor API.