Introducing Database Traffic Control™: resource budgets for your Postgres query traffic.Learn more
Navigation

Database Traffic Control™

Postgres has no built-in way to fight back against bad queries, unexpected spikes, or runaway workloads. It accepts everything thrown at it until performance degrades or the whole thing falls over. PlanetScale's Database Traffic Control gives Postgres what it's always lacked: the ability to fight back.

Try Traffic Control Read the docs

How it works

Traffic Control uses budgets to cap resource usage for specific slices of your query traffic. A budget defines limits on things like:

You target traffic using rules that match on the dimensions you care about:

Budgets can run in warn mode to observe what would be throttled, or enforce mode to actively block queries that exceed limits. Enforced budgets can also emit warnings at a separate threshold, so you know when workloads are approaching their limits before queries get blocked. Switch between modes at any time.


Use cases

Incident response

A rogue query is spiking CPU and degrading performance for your entire application. Find it in Insights, create a budget to cap its resource usage, and stabilize your database while your team investigates.

Priority-based traffic shaping

Tag queries by priority and create budgets for each tier. Core features get protected resources while lower-priority background jobs can't starve them out.

Protecting users from AI agent traffic

As AI-powered features drive more queries to your database, Traffic Control sets guardrails so automated traffic can't overwhelm the queries powering your real users' experience.

Prioritizing paid tiers

In multi-tenant apps, use tags to identify traffic by customer or tier and budget accordingly. Enterprise customers stay protected during load spikes caused by free-tier users.

Safe deployments

Tag queries by deployment version or service name. If a new release generates expensive queries, you have an instant kill switch to throttle that traffic while you roll back.

Regional traffic management

Tag queries by region and set budgets so traffic from one geography can't degrade performance for users elsewhere.


Works with Insights

PlanetScale Insights tracks historical statistics for every query running against your database. When something goes wrong, find the problematic query in Insights, see detailed usage data, and set up a budget to restrict it in just a few clicks.


Watch the demo


Getting started

Traffic Control is available today for all PlanetScale Postgres databases.

  1. Navigate to your database in the PlanetScale dashboard
  2. Open Insights and go to the Traffic control tab
  3. Create your first budget by selecting the dimensions and limits you want to enforce
  4. Start in warn mode to observe the impact, then switch to enforce

Traffic Control is also available via the PlanetScale API and CLI, so you can automate budget creation as part of your deployment pipelines.

Read the docs Read the announcement


Resources

Documentation

Full reference for budgets, rules, modes, and sqlcommenter integration.

Read the docs

Announcement

Read about why we built Traffic Control and how it fits into PlanetScale Postgres.

Read the blog post

Demo application

Try it out yourself by running our demo application with pre-built budgets

Clone the app

Watch the walkthrough

Head to our YouTube for a walkthrough covering how to use Traffic Control

See the video