Introducing Database Traffic Control
Blog post from PlanetScale
Database Traffic Control, introduced by PlanetScale for Postgres databases, addresses the challenge of managing unexpected spikes in query traffic that can degrade performance or crash servers. This system allows users to set flexible budgets that determine how much of the database's resources a given workload can consume, with Postgres enforcing these limits. Users can create budgets based on query patterns, application names, database users, and custom tags, enabling resource limits on CPU usage, concurrency, and query timing. Budgets can operate in either warn mode for observation or enforce mode to actively block queries that exceed set limits. This feature proves useful in various scenarios, such as incident response, priority-based traffic shaping, isolating AI from human traffic, and prioritizing different customer tiers in multi-tenant applications. Available through the PlanetScale dashboard, API, and CLI, Database Traffic Control allows for automated budget creation within deployment pipelines, offering a powerful tool for maintaining database stability and performance.