# Move Fast and Don't Break Things: Scaling Databases for the AI Era — PlanetScale

Ben Dicken, PlanetScale

AI Engineer World's Fair 2026

[Talk page](https://ai.engineer/talks/uKUA1a0Kdfc-move-fast-dont-break-things-scaling-databases) · [Video](https://www.youtube.com/watch?v=uKUA1a0Kdfc)

## Move Fast and Don't Break Things: Scaling Databases for the AI Era

Ben Dicken explains how isolation, redundancy and overload controls support growing databases—and how configuration files, resource budgets and schema branches give AI agents safer ways to operate them.

### Agent speed meets infrastructure limits

[0:12](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=12s)

Shipping faster creates value only while the application can keep serving its users. AI agents intensify both sides of that problem: they help write and deploy features, and they generate demand that existing infrastructure must absorb. In this talk, Ben Dicken of PlanetScale starts with the familiar ambition to “move fast” and asks how to keep databases and application servers healthy while doing it.

Rapid growth makes the tension concrete. An application can gain multiples of its previous daily active users while its infrastructure struggles to catch up. The desired result is a healthy status page and three, four or perhaps five nines of availability. Those are aspirations here, rather than measured results for a demonstrated system. Scaling to tens or hundreds of millions of users remains a hard engineering problem.

PlanetScale operates databases for fast-growing AI companies, including Cursor. The explanation proceeds through three questions: how to keep systems available at any size, how to increase their capacity as usage grows, and how to give agents some control over that infrastructure without making each change a company-wide gamble.

### Contain failures, then prepare for them

[3:24](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=204s)

Isolation begins with a specific failure: a bad deployment takes down the control plane. The data plane—the databases holding the critical information users need to log in and use the application—should remain accessible. Observability pipelines, analytics systems, apps and MCP components can also fail. Keeping them isolated prevents a frequently changed supporting component from bringing the database down with it.

Redundancy addresses a different problem: the database server itself can fail. Replacing stateless application compute is comparatively straightforward; another instance can handle requests without having to recover the application's stored data. Database failover must preserve state. The common arrangement described here sends most traffic to a primary and keeps replicas or followers in other data centers or availability zones ready to take over. That adds cost and complexity. The talk does not specify replication or failover protocols, so the topology alone does not establish a zero-data-loss guarantee.

Fleet size changes how often the operator encounters failure. With one server and 100 users, a failure might be a once-in-several-years event. Across thousands of servers, failures can become weekly or monthly events even when individual machines are reasonably dependable. Reliability therefore requires a routine way to survive broken machines. Isolation and redundancy remain useful from small applications through millions of daily active users; growth adds capacity problems rather than retiring those principles.

### Spread the data without losing redundancy

[6:53](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=413s)

A single database node may work well with ten gigabytes of data. Ten terabytes, 100 terabytes or a petabyte changes the capacity problem. Sharding spreads data and queries across multiple servers, with a proxy between clients and those servers to distribute requests intelligently. PlanetScale uses Vitess for MySQL sharding and Neki for Postgres.

Where does fault tolerance live after the database is split? Inside each shard. Shard A should contain a primary and several replicas, so a failed server can be handled within that shard. The topology combines two separate mechanisms: routing distributes the workload across shards, while redundancy keeps an individual shard available when one of its machines fails.

![VTGATE sits between the application and four shards; the diagram shows routing across shards, while the shard-internal replicas described in the text are not pictured.](https://ai.engineer/api/talk-essay-media/822b68d937c380da8e27135d6de47144067a691419d7af20701d8b5eacd63f2f)

VTGATE sits between the application and four shards; the diagram shows routing across shards, while the shard-internal replicas described in the text are not pictured.

Routing across shards, redundancy within shards
The branches show query routing to separate MySQL shards. Each shard contains its own primary and replicas; spreading data across servers does not replace failover capacity.
- MySQL queries — Requests enter the routing layer.
- VTGate — Parses queries, determines the destination shard and routes requests.
- Shard A — A MySQL shard with a primary and several replicas for recovery from server failure.
- Other shards — Other MySQL partitions receive their routed queries; redundancy also belongs within each shard.
- MySQL queries → VTGate (Submit queries)
- VTGate → Shard A (Route queries belonging to this shard)
- VTGate → Other shards (Route queries belonging to other shards)

### Reject excess work and scale services independently

[8:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=503s)

More servers do not eliminate overload. Too many queries, excessive CPU use or exhausted cache memory can still bring a database down. Backpressure makes the system respond before that failure: once resource use crosses a threshold, it can fail requests, deny queries or refuse connections. Some traffic degrades so that the remaining traffic can keep working. The rest of the application must support those responses; a database's refusal to accept work needs to be an expected operating condition.

Decoupling addresses the resource competition that appears when several jobs share one system. Combining transactional database work, analytics, queues, job processing and caching has an obvious convenience: fewer services to operate. But Dicken identifies two costs:

- **Shared failures:** When the combined service goes down, all of those functions can go down together, undermining isolation.
- **Shared resources:** A burst of queued jobs can compete with other workloads even when those workloads have not grown.

The queue burst gives decoupling a practical test. If only the queue needs more compute, separating it lets the operator increase its resources independently of the transactional database, analytics or cache. Sharding, backpressure and decoupling solve distinct parts of scaling: distributing work, limiting admitted work and separating workloads whose capacity needs can diverge. They are useful building blocks, rather than a complete account of database scalability.

### Give the agent a sharding configuration it can work on

[11:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=683s)

Generating application code and changing a production database carry different consequences. A mistaken configuration or sharding change can affect the entire application, and recovery may be much harder than undoing a code edit. The next question is therefore how an agent can work through a manageable interface while the database platform handles the complicated infrastructure underneath.

Vitess provides a concrete example. Its MySQL shards sit behind VTGate, an intelligent proxy that parses queries, determines which shard they need and routes them. The sharding design is expressed through a VSchema: a JSON file that specifies the column to shard on, the sharding method and table-placement choices. The important distinction is between a complicated execution system and an editable configuration describing how it should distribute data and queries.

![The VSchema JSON names an xxhash vindex for user_id, while the diagram shows VTGate routing between the application and four shards.](https://ai.engineer/api/talk-essay-media/d283fdb5a1b4dd20b4b1d6cd8aa427bb5d35ef4dd7b6b1703e1425c3ea3a4fbe)

The VSchema JSON names an xxhash vindex for user_id, while the diagram shows VTGate routing between the application and four shards.

```json
{
  "sharded": true,
  "vindexes": {
    "xxhash": {
      "type": "xxhash"
    }
  },
  "tables": {
    "user": {
      "column_vindexes": [
        {
          "column": "user_id",
          "name": "xxhash"
        }
      ]
    }
  }
}
```

The proposed agent workflow starts with an existing schema and a scalability problem. Give those inputs to the agent, ask it to prototype a VSchema, then develop the sharding design before deploying the configuration through PlanetScale's interfaces. APIs and a command-line interface allow the agent to assist with, or take some control over, that process. Text and JSON make the work accessible to an agent; they do not by themselves prove that its sharding choices are efficient. No particular schema, generated plan or benchmark is developed in the spoken example.

### Budget traffic before an agent surge exhausts the database

[14:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=863s)

Agent-generated demand brings the earlier backpressure principle into focus. Dicken recalls GitHub reporting a large traffic increase attributed to agents, although his recollection leaves the multiplier uncertain. PlanetScale's Traffic Control addresses the operating problem by categorizing and tagging database traffic, then assigning resource budgets to those categories. A segment of traffic can be limited by CPU usage or backend processes instead of being allowed to consume whatever the database has left.

What does exceeding the budget look like? The graph described in the talk shows the amount of queries exceeding a configured budget over time. Traffic Control can then respond at different levels:

- **Warnings:** Send feedback to the client that the database is overloaded and it needs to slow down.
- **Stricter enforcement:** Kill executing queries to enforce the limit.

The graph makes budget exceedance visible; the response determines whether the system merely warns about excess work or actively stops it.

Rejecting work has a cost: some requests fail. The intended benefit is to preserve service for other traffic rather than let overload take the entire application offline. This also closes the feedback loop introduced earlier: warnings only help if clients respond by slowing down, while enforced limits can protect capacity even when incoming demand keeps rising.

### Mirror code branches with isolated schema changes

[15:52](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=952s)

Application features often require schema changes alongside code changes: new tables, new columns, deletions or indexes. Developers already have a familiar way to isolate code work—branch from main, edit, review, merge and deploy. PlanetScale applies that Git-like experience to the database schema. A schema branch provides an isolated environment for changes; a deploy request merges those changes into production, with no downtime as described in the talk.

What happens if the deployed schema causes a problem? The interface includes a one-click revert, which Dicken describes as returning to the previous database state without data loss. In this schema-change context, the useful promise is recovery from the deployment without sacrificing data. The talk does not explain the underlying revert mechanism or its operating constraints, so this should not be extended into a guarantee that any database operation can be undone.

APIs and CLIs make the same workflow available to agents. An agent creating code branches, pull requests and reviews can also maintain a corresponding database schema state, keeping the two kinds of changes in sync. Automation can be full or partial; human review remains an explicit option. Isolation, deployment and recovery are platform primitives the workflow can use rather than procedures the agent must invent each time.

### Operational developer experience becomes agent infrastructure

[17:22](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=1042s)

The ending gives developer experience an operational definition. Light and dark modes or keyboard shortcuts may improve an interface, but the consequential tools help the person responsible for a database deploy safely, avoid mistakes and improve performance. These capabilities existed for human developers before agents; agents now benefit from the same deliberate ways to configure, isolate and recover changes.

PlanetScale exposes many of those capabilities through an MCP server and command-line interfaces. Dicken leaves the debate over which interface is better open. The useful conclusion is more concrete: when infrastructure gives operators clear configuration inputs, resource controls and safe change workflows, it also gives agents practical tools for helping databases scale. The quality of the underlying operations matters as much as the agent's ability to call them.

## Key takeaways

- Isolation keeps a failed supporting component from taking down the data plane; redundancy prepares each database shard to survive server failure.
- Sharding distributes data and queries, backpressure limits overload, and decoupling lets workloads scale independently.
- A JSON VSchema gives an agent an editable sharding plan while Vitess and VTGate handle query routing underneath.
- Traffic Control applies resource budgets to tagged traffic, with warnings or query termination to preserve capacity under excess demand.
- Schema branches, deploy requests and reverts give agents the same controlled change workflow built for human developers, with human review where desired.

## Slides

### Move fast and don't break things

AI agents can write and deploy code, but the speaker argues teams can still ship quickly while keeping databases and application servers running.

[0:45](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=45s) [The words “move fast and (don't) break things” above a short green graph trace.](https://assets.ai.engineer/sites/aiecode2025/sha256/d40d324587c959654db10920f9a9349443defa1177d2260e680de68c33fbdb04.webp)

move fast and
(don't) break things

1

### Move fast and don't break things: graph build

A calm green trace spikes into a jagged red one as the speaker argues for shipping fast without breaking databases, infrastructure or application servers.

[0:55](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=55s) [The title overlays a green graph that spikes into a jagged red trace, with “break” highlighted in red.](https://assets.ai.engineer/sites/aiecode2025/sha256/0cf73128abdbcc2ee56f07a11c29d92ce72e26d065a4866069499174e8af8904.webp)

move fast and
(don't) break things

Interface text:
1

### Service availability over 90 days

Four 90-day status histories show mostly green bars interrupted by yellow and red, with availability ranging from 95.4% to 98.2%. The speaker uses them to illustrate infrastructure struggling to keep up with rapid growth.

[1:06](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=66s) [Four colored status histories show availability for App, API, Platform and Enterprise, ranging from 95.4% to 98.2%.](https://assets.ai.engineer/sites/aiecode2025/sha256/74b641725c0fb23b3c756c2879795eb694523b701ef75782a3d06a006ecde70a.webp)

90 DAYS AGO  97.8%  TODAY
APP

90 DAYS AGO  96.1%  TODAY
API

90 DAYS AGO  95.4%  TODAY
PLATFORM

90 DAYS AGO  98.2%  TODAY
ENTERPRISE

Interface text:
2

### How do we build and scale reliable systems?

The talk moves from keeping systems up to scaling them for millions of users, then asks how AI agents can help with both.

[2:24](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=144s) [Three questions ask how to build fault-tolerant systems, scale them, and do both with AI agents in control.](https://assets.ai.engineer/sites/aiecode2025/sha256/bacfc8e14d860863076089fcf5cccace3207614467ff7ab4257dc4db3f6b8e60.webp)

how do we

build fault tolerant systems?
scale those systems?
do both with AI agents in control?

4

### Build fault-tolerant systems

The first question is how to keep systems from going down, before scaling them and involving AI agents. Ben introduces PlanetScale’s experience supporting fast-scaling AI companies.

[2:52](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=172s) [The agenda highlights “build fault tolerant systems?” while the two later questions are dimmed.](https://assets.ai.engineer/sites/aiecode2025/sha256/fb97c535744b58792166df51cbcb36ceef22b8e8ade19aff2138316fccb2012b.webp)

how do we

build fault tolerant systems?
scale those systems?
do both with AI agents in control?

5

### The principles of extreme fault tolerance

Ben draws on Max Englander’s article to explain PlanetScale’s philosophy for operating databases.

[3:18](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=198s) [An engineering blog reference titled “The principles of extreme fault tolerance,” credited to Max Englander and dated July 3, 2025.](https://assets.ai.engineer/sites/aiecode2025/sha256/16bc909b585c6c6a9582a701b557444bb9e8dd761f8853b89fbfd12c420127e4.webp)

Blog | Engineering

The principles of extreme fault tolerance

Max Englander | July 3, 2025

Interface text:
6

### Isolation and static stability

The data plane sits apart from the control plane and observability. Isolation keeps a control-plane failure from blocking database access; static stability lets components operate from their last known good state.

[3:29](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=209s) [Isolation principles alongside a diagram connecting end users, app, MCP, data plane, control plane, and observability.](https://assets.ai.engineer/sites/aiecode2025/sha256/c96841ffb81c148a649cc0386174a59ecfac39be0071d39ef64fe357ff1eb8b2.webp)

isolation + static stability

Physically and logically independent
Failures do not cascade
minimal critical-path dependencies
Operate from last known good state

CONTROL PLANE
OBSERVABILITY
END USERS
APP
MCP
DATA PLANE

7

### Redundancy

Most traffic goes to the primary database, while a follower in another availability zone stands ready to take over if a server fails.

[4:36](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=276s) [Redundancy slide showing an application connected to a primary and a follower in separate availability zones.](https://assets.ai.engineer/sites/aiecode2025/sha256/c2888cce5793a85ba4bedd08329e65cd30f19677c84377270c1ffdfec87b6a38.webp)

redundancy

isolated copies of every critical component

APPLICATION

AZ-C
PRIMARY

AZ-B
FOLLOWER

8

### How do we scale those systems?

The talk turns from fault tolerance to scaling, while keeping redundancy and isolation in view. AI agents come later.

[6:43](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=403s) [Three agenda questions, with scaling those systems highlighted.](https://assets.ai.engineer/sites/aiecode2025/sha256/b2181efcda6ea7d5936ac14442f0b8f6d38165ce420f762ffb4a74add8ebc5b4.webp)

how do we

build fault tolerant systems?
scale those systems?
do both with AI agents in control?

12

### Sharding

Sharding spreads data and queries across servers. In the diagram, VTGate sits between the application and four shards, routing requests; each shard stays small enough to move.

[6:50](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=410s) [Sharding slide showing an application connected through VTGate to four shards.](https://assets.ai.engineer/sites/aiecode2025/sha256/4fdb3938bff8ad64ed4203ac73c0d139909f728a82867b767807b64b8717ceff.webp)

sharding

Partition work by tenant or key
Keep each shard small enough to move

APPLICATION
VTGATE
SHARD A
SHARD B
SHARD C
SHARD D

13

### Backpressure

When resource use passes a threshold, a system can reject requests or connections to keep existing users and some traffic healthy while other traffic degrades.

[8:27](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=507s) [Backpressure slide showing a client connected to a partially filled database.](https://assets.ai.engineer/sites/aiecode2025/sha256/53bfde557474646ea098ec449bc7f2af393605da5487085fadf083160c92c28c.webp)

backpressure
Slow callers before systems saturate
Protect critical paths under load

CLIENT
DATABASE

14

### Decoupling

Separating OLTP, analytics, queues and cache reduces resource competition and lets each scale independently. It also helps isolate failures between services.

[9:35](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=575s) [Decoupling principles above separate boxes for OLTP, OLAP, queue, and cache.](https://assets.ai.engineer/sites/aiecode2025/sha256/b486c075752f99da286e87381b9d41e714db53d3fc3b6b2b258360ff9133df4c.webp)

decoupling

Unix philosophy. Do one thing, do it well
Separate concerns in infrastructure
Reduce resource competition

OLTP
(POSTGRES)

OLAP
(DUCKDB)

QUEUE
(KAFKA)

CACHE
(REDIS)

15

### How do we put AI agents in control?

The talk turns from fault tolerance and scale to giving agents partial or full control of infrastructure. Database changes raise the stakes: mistakes can take down an application.

[11:00](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=660s) [Three questions about fault tolerance, scaling, and AI agents, with the last highlighted.](https://assets.ai.engineer/sites/aiecode2025/sha256/239fe669986aa38ba6a64e92d149069cf1b26a9a015d059644ce03a4f34166bd.webp)

how do we

build fault tolerant systems?
scale those systems?
do both with AI agents in control?

16

### Sharding

VTGate routes application queries to shards. A JSON VSchema specifies the sharding column and method, giving an AI agent a text file it can use to prototype a configuration.

[12:13](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=733s) [A sharding configuration and diagram showing an application routing through VTGate to four shards.](https://assets.ai.engineer/sites/aiecode2025/sha256/c9b8b97c525299e58291bfb2d8c35bc4ee6b72480d5aa3c440200334787a02ac.webp)

sharding

Sharding specified with JSON / VSchema
Easy for agents to understand
Easy to control traffic flow / revert

{
  "sharded": true,
  "vindexes": {
    "xxhash": {
      "type": "xxhash"
    }
  },
  "tables": {
    "user": {
      "column_vindexes": [
        {
          "column": "user_id",
          "name": "xxhash"
        }]
    }}
}

APPLICATION
VTGATE
SHARD A
SHARD B
SHARD C
SHARD D

17

### Traffic control

Traffic Control tags database queries and assigns resource budgets. The chart shows queries exceeding a budget in warning mode; stricter limits can kill queries to protect the application.

[14:08](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=848s) [Traffic control principles alongside a resource budget activity chart and settings.](https://assets.ai.engineer/sites/aiecode2025/sha256/39f1c9108f2350c8f6d3d18557747469cf37820d5713a09a66674999add4acfb.webp)

traffic control

Categorize query traffic
Set up resource budgets
Apply backpressure to source

Interface text:
This budget resource is in warning mode
Matching queries will consume capacity but will not be blocked.

Resource budget activity
Past day
33.4k
15:15 PDT
Y-axis ticks: 0, 15k, 30k, 45k
Timeline: 10:00, 13:00, 16:00, 19:00, 22:00, 01:00, 04:00, 07:00
Warnings: 33.4k
Blocked queries: 0

Budget tags
Queries match this budget when they contain the following tags:
category: gameplay
Edit rules

Budget settings
Adjust how much capacity matching queries can consume and how quickly that capacity recovers.

Example capacity over time
Y-axis ticks: 100%, 50%, 0%
Example shows multiple queries each consuming 0.5 sec of capacity, recovering at 5% server share. Queries that would drive capacity below zero will emit warnings.

Set server share and burst limit
Controls how capacity is metered using a token bucket. Without limits, capacity is never depleted by usage.
Server share: the rate at which capacity refills, as a percentage of server resources.
5 %
Burst limit: the maximum capacity that can be banked, measured in seconds of full server usage.
0.4 sec

Query violations
Query | Checks | Warnings | Blocks
with recent_games as (select status from games where created_at >= now() - interval $1 order by created_at desc limit… | 1,542,046 | 1,464,414 | 0
select id, status, fen, white_time_ms, black_time_ms, state_version from games where status = $1 order by last_move_at … | 1,542,046 | 1,468,499 | 0

18

### Schema evolution: deploy request

PlanetScale mirrors a Git-style workflow: branch a database schema, change it in isolation, and merge it into production through a deploy request without downtime.

[15:45](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=945s) [Schema evolution slide beside a deploy request interface.](https://assets.ai.engineer/sites/aiecode2025/sha256/c895c0ad19645617d4df74cc23700f8558dbcc7cdca8ae534f6bff29146d0285.webp)

schema evolution

Branch, change, deploy request
Online DDL powered by Vitess and Neki
Rollback keeps agents safe

Interface text:
Deploy requests > Deploy request #9
Deploy request #9  Open
Opened by Benjamin Dicken on [illegible] to deploy to main
Review changes
Summary  Schema changes
Benjamin Dicken opened this deploy request
just now
Leave a comment
Comment
1 Created table
1 Altered table
0 Dropped tables
View schema changes
item
ALTER TABLE
Keyspace: game
Not started
visited_planet
CREATE TABLE
Keyspace: game
Not started
Instantly deployable
Deploy changes
Auto-apply changes
Cancel
Confirm deployment
Copy migration data
Your framework’s migration table data can be copied to new branches and in deploy requests automatically.
Choose framework
Close deploy request
19

### Schema evolution: revert changes

The demo shows a confirmation to revert deployed schema changes. The speaker says a revert restores the previous database state without data loss, and agents can automate the workflow through APIs and CLIs.

[16:25](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=985s) [Schema evolution slide beside a dimmed interface with a revert confirmation dialog.](https://assets.ai.engineer/sites/aiecode2025/sha256/8762b3511c4745f5e7eb5653ae969647cb41a2b41a8b4a311d3ad5dbdebf7335.webp)

schema evolution

Branch, change, deploy request
Online DDL powered by Vitess and Neki
Rollback keeps agents safe

Interface text:
Revert schema changes
Are you sure you want to revert the schema changes that were deployed?
Cancel
Revert changes
The revert has been submitted
19

### Schema evolution: branch changes

A development branch shows an added price column and a new table, with a deploy request targeting main. PlanetScale says schema changes can merge into production without downtime.

[16:28](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=988s) [Schema evolution slide beside a development branch interface showing schema changes.](https://assets.ai.engineer/sites/aiecode2025/sha256/849f0655ffcd59f785ff265a50c633bea7596e23482f4c77d3ea09f6e8d5f696.webp)

schema evolution

Branch, change, deploy request
Online DDL powered by Vitess and Neki
Rollback keeps agents safe

Interface text:
Branches > Schema
Branch: visited
Connect
Keyspace: game (unsharded)
Show: Changes only
Sort by: Name
Filter tables...

item
CREATE TABLE `item` (
  [illegible]
  `price` int NOT NULL DEFAULT '0',
  [illegible]
)

visited_planet
CREATE TABLE `visited_planet` (
  [illegible]
)

This is a development branch
Safe migrations not enabled
Vectors not enabled
Safe migrations can be enabled if you'd like to use this development branch as a staging database.
Learn more
Branch ID: [illegible]

1 Created table
1 Altered table
0 Dropped tables
Previous deployments
Deploy branch changes
Changes can be deployed to branches with safe migrations enabled.
Deploy to: main
Optional information about your deploy request
Create deploy request
Open web console
Delete branch

19

### Primitives for scaling your infrastructure with AI

PlanetScale's tools for safe deploys and better database performance also give AI agents primitives to work with databases. They are exposed through its MCP server and command-line interfaces.

[17:39](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=1059s) [Cream text centered on a dark background reads, “primitives for scaling your infrastructure with AI.”](https://assets.ai.engineer/sites/aiecode2025/sha256/b9a786b3865cdfaaef762d4025d3957b523ad49b629011782a0c20e16d638ed7.webp)

primitives for scaling your
infrastructure with AI.

20

## Full transcript

[0:12](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=12s) Hey everybody, how's it going? Hope you're having a good last day of AI Engineer. Uh, what I'm gonna talk about today is how to move fast and not break things. So the, the phrase move fast and break things, you've probably heard this before, and what this, uh, refers to is it's a phrase from early Facebook engineering culture days, right? And the idea was we wanna be able to move fast and ship fast and not be constrained by, you know, databases going down or breaking certain features because the priority is there's so much value in

[0:42](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=42s) shipping fast. And this was 20 years ago, right, before we had AI agents writing code for us and shipping things and deploying things on our behalf. So if anything, the idea of doing this is more true than ever, but in my opinion, we can actually achieve both, right? I wanna be able to ship fast, build great features, get things out to my customers, but also not break the databases, the infrastructure, the application servers that are powering what I'm doing. And we've probably all seen something that looks approximately like this, and I'm

[1:11](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=71s) not calling out any particular company. There's a number of companies, right? That due to the kind of insane scale that we've seen over the past even six months, year, two years, right? Where we've had, like, daily active users double, triple, 10X, 100X, a lot of that powered by, like, the demand of AI agents, um, where the infrastructure struggles to keep up. And some of this is simply because it's a very hard problem, right? This is not meant to call anybody in particular out. It's hard to scale things to tens of millions or hundreds of millions of users.

[1:42](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=102s) But what we'd like to have is great products that scale well for lots of users and have our status pages look a little bit more like this one, right? Three or four nines of availability,  uh, maybe five nines of availability, where our databases are healthy, our applications are healthy, and ultimately, our users are happy, right? So this is kind of the idea behind what I wanna talk about, which is a little different than probably most of the talks you've been at. A lot of the talks are probably talking about inference or specifically how to do things with agents or different kinds of automations.

[2:12](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=132s) This is more of an infrastructure talk, but how you can do that and ship fast both with the demand of AI agents as well as the y- you being able to use AI agents to make all of these processes more optimized and smoother.  So there's three parts to this that I wanna talk about. The first one is, how do you even build systems, regardless of the number of users you have, that aren't going down all the time? And then tying that into, well, okay, if you're gonna build the next hit application that's gonna scale to millions of people

[2:41](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=161s) using it, how do we scale that using these same principles? And then finally, how can we take these two things and let AI agents do them for us, or at least in part work with them in doing this?

[2:54](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=174s) So I should probably introduce myself a little bit too. The reason why I'm talking about this is I'm Ben, and I'm from PlanetScale, and we do databases. This is our whole thing. And we work with a lot of these AI companies that are scaling extremely fast. We work with companies like Cursor, for example, and power databases for them. And so this is something that we as a company take very seriously. How do we scale and support companies that have millions of users, uh, on their platforms? And some of what I'm talking about comes from a article that we published last year about

[3:24](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=204s) kind of our philosophy of how we operate databases. I would encourage you to go Google that and read that. Um, but a couple of these principles, let's go over some of these. So the, the first and one of the most important is isolation, right? When you are running infrastructure, one of the things you wanna make sure you do is have a setup where if something fails, it doesn't take down the whole system, but every component is very isolated. So what I'm showing here is data plane. That basically means where are your databases? Where does your most critical data live that you need to

[3:54](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=234s) be using for your users to log in and interact with your application? But there's lots of other components, right? There's your control planes. There's your observability pipelines. There might be your analytics frameworks. There's your apps. There's your MCPs, and there's all these different components that can potentially fail, and in fact, assuming you're using a good database platform, the database is hopefully low likely to fail. But these other things you're shipping and deploying to more frequently so are more likely to fail. So we wanna make sure that we've designed things where if I deploy a bad ship to the control plane and

[4:24](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=264s) take it down, nothing else is impacted and can still access the database, right?  And anything in my data plane. So this is one of these kind of core principles that we take very seriously. And another thing  is redundancy. And if any of you have worked with databases before in the past, you've probably seen a diagram that looks something like this, and similar things apply to your app infrastructure and your other infrastructure. Although in the case of application servers, usually redundancy is a little bit easier to

[4:54](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=294s) solve because it's a stateless workload, right? There's lots of sort of auto-scaling, Cloudflare Workers, and Vercel functions, and AWS Lambda that can scale and have redundancy very easily because it's not storing state. But in the database world, you have to store state reliably. You can't lose a single byte of data, and so how do you do this? Um, a very common approach which costs more money and is more complex, but it's the way that you scale reliably, is by having a primary node. So this is where most of your traffic goes to, but you always have replica servers

[5:24](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=324s) or follower servers standing by in different data centers or different availability zones ready to take over because the fact is servers do fail sometimes. Uh, and on a small scale, when you've got an app that has 100 users and you have one database server, you might only experience a failure once every couple of years. But at a large scale, when you have thousands of servers, a once or twice-a-year failure becomes a weekly or monthly failure, and so you need to have systems in place to deal with this very well.

[5:53](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=353s) Okay, so we've talked about, uh, what the principles of a- of scaling reliably are or of, um, having reliable systems are. But then the question is, what I've just told you here- We could write a whole book on, right? So there's lots more that, you know, there's people who spend their entire careers focused on this, so we're going a little bit quickly through it. But these principles apply no matter what point of this user growth chart you're at, right? You could be at 100 users, and in this case, uh, it's

[6:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=383s) still good to have redundancies, to have isolation, to have failure even for that smaller set of users, and you wanna apply those same principles when you are all the way up here. I don't know if you can see that line very well. But at millions of daily active users. But there is a point where you actually have to incorporate different technologies to scale efficiently and effectively. So, uh, let's talk about how we scale those systems for a few minutes, and probably the part you're most excited about is the AI agents part, which we'll get to at the end. Um, so one of

[6:53](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=413s) the key things, and this is what we do a lot of at PlanetScale, is sharding. Um, I just realized my mouse is on the screen, so let me get that off the screen here. See if that will go away eventually. Um, so database sharding. What is this? What you do is instead of relying on that single node, which works fine when you have ten gigabytes of data, it doesn't work so well when you have ten terabytes of data, or 100 terabytes of data, or a petabyte of data. So what do you have to start doing? Well, what you need to do is spread your data and your

[7:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=443s) queries out across many servers, and so that's what all of these shards down here below are. And typically you put some kind of proxy, and we'll talk more about what VTGate means later, in between that intelligently handles distributing all of the user requests or the query requests across all of these servers. Uh, and this is exactly what we do a lot of for some large customers at PlanetScale. We do sharding through Vitess for MySQL and Neki for Postgres. Um, and so this is a very fundamental way of doing sharding. But the other thing is you don't just use

[7:53](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=473s) sharding by itself. If we look at this and we see, for example, shard A, b- within that box you actually would want a redundant system. So you'd have a primary and several replicas in there. So if one of those servers fail, that single shard can do self-healing and get back online very quickly if there's a problem. So this is one of the ways that we see and is probably the most common and performant way to scale databases. But really the same principle of, hey, let's take queries and data and spread them out across many servers, many

[8:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=503s) nodes, many drives, uh, applies to lots of other areas of the stack that you're building. Backpressure. So this is another one that is sort of a, a mix of being a part of scalability but also a part of reliability. And what we mean here is there's a lot of systems like MySQL and Postgres and SQLite, these very popular databases that people run, that don't do a good job at handling being overloaded. The moment that they have too many queries or using too much CPU or they run out of RAM for the

[8:53](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=533s) cache, in many cases if not taken a lot of care for, they'll just crash. And now your server is down, and now all of your users are impacted and they can't use your service that the database is powering. What backpressure is, is it's designing a system to be able to push back and say, "When I detect that I'm above a certain threshold of resources, I can actually say I wanna push back and start failing requests, denying query, uh, denying connections, right, so that I can keep the existing users or some of the traffic healthy while gracefully degrading some

[9:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=563s) of the other traffic." And then the rest of your stack has to be built to support that. So this is a principle that applies in lots of areas of the stack, but in the database it's arguably the most important. Uh, let's see here. Where are the clicker? There we go. And then the last component of this that I wanna talk about before we move into how to do this all with AI is decoupling. Uh, there's a lot of people that you'll talk to, and when it comes to databases, will argue that you should probably have all of your services combined into one because there's some convenience to

[9:53](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=593s) that. Your Postgres database, your OLTP workloads combined with what you're doing for analytics, combined with your, your queuing and your job system, your caching. There is convenience and some technologies try to do this where we put this all in one, but that does one, add a lot of complexity, but it also breaks some of the fundamental principles from earlier like failure isolation, right? If one service goes down, that actually means everything is going down. And then you also have to deal with contention of resources. So if you suddenly have a burst of queue jobs

[10:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=623s) and you need to scale up your queues, but maybe nothing else really needs to scale, it would be nice if we can independently scale the amount of compute resources that we've given to each of these parts of our backend service powering your favorite application, right? So this is not a complete list. What did we go through so far? We went through sharding, we went through backpressure, and now we're talking about decoupling. There's many other aspects to scalability and again, you could spend your entire career becoming an expert in scalability, uh, but

[10:53](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=653s) this is a lot of what we think about a lot at PlanetScale because our customers rely on us to be reliable and to scale. So finally, let's go to the last part of this. We-- let's say we have all of these principles in place. We are doing things reliably where we have fault tolerance. We're doing things that are very scalable. But these days, in a lot of organizations, and we talk to a lot of people that feel this both at the small scale and at very large organizations, how can we allow

[11:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=683s) agents to, whether in part or in full, have control over what is arguably the most important infrastructure of your company, right? The databases, the queues, the things that are powering every other layer of your stack. Um, and this is something that can be a little bit intimidating because it's pretty much the standard these days, right, to write code with AI. In some cases, people are not even writing any lines of code anymore, right? AI is actually writing all of your code, reviewing all of your code, um, and you're just sort of guiding these agents to doing that.

[11:53](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=713s) But it is quite different to say, "I'm gonna now also give my agents the ability to deploy changes to the database or make changes to how things are configured there or to shard my database," right? Because that's something if it gets wrong, it's generally not as simple as clicking a button to roll it back, right? It's taking down your entire application and every user notices. So we wanna do this effectively and safely. So I'm gonna revisit a couple of the concepts that I previously talked about and think about how do we use agents to solve this. So

[12:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=743s) going back to sharding. What I'm gonna talk a little more specifically about is Vitess, and this is an open source project. Uh, we operate Vitess databases for our customers, and it works with MySQL to do sharding. So what you can see here is, like, all of those shards down there, those would be MySQL databases. And the VTGate, that's the proxy. That is basically an intelligent proxy that takes MySQL queries, parses them, figures out which shard they need to go to, and routes all of those requests in a very sophisticated way. So the software is fairly

[12:53](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=773s) complicated, but the interface that we present for specifying how do you want all of your queries and your data sharded is actually quite simple. It's what we call a VSchema, and it's literally a JSON file where you say, "Here's the column I wanna shard on, and here's the way I wanna do sharding." And you can specify certain tables to go on certain shards and have lots of control over where and how things are configured. And the great thing is, as we all know, AI agents are excellent at working with things like text files and JSON files. So you can give your agent and say,

[13:22](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=802s) "Hey, I'm struggling with scalability of my database. Here's my schema. I want you to come up and help me prototype a good VSchema," right? And once you've developed and designed something that it has thought through and made decisions about the most efficient ways to shard when you are on a platform like PlanetScale, you literally will plug this in and you make a deploy, and you, you c-- we give you an interface for creating new sharded systems and scaling up your database. And a lot of this can happen with either the help of AI or letting a-AI take some control over these processes, uh, given our API and our

[13:52](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=832s) command line interface that we run. So this is one of those things, right? Very complex infrastructure in reality under the hood that is scaling your systems, but you provide the right interfaces for it, like simple configuration files, and those things become much more accessible to any company trying to scale. Um, another thing, so this is getting into the, uh, concept of back pressure that we talked about earlier, right? So when a database is overloaded, and this, as you might imagine, probably happens all the time at some of these companies, right? I think there was a,

[14:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=863s) a tweet a couple of months ago from GitHub that basically said, like, their traffic had, like, two or three or four x from what already was an extremely high load, and pretty much all of that was attributed to AI agents, right? So they already had gigantic infrastructure 'cause they're the most popular place in the world to develop, and then they had multiple, uh, uh, traffic increases, especially over, like, the holidays, right, due to these, uh, overloaded systems. So how do we deal with this? One of our solutions and the way that we like to think about it is we give users a

[14:53](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=893s) system called Traffic Control, which allows you to essentially categorize and tag all of the traffic coming into your database, and then you create resource budgets to say, "Hey, this segment of my traffic cannot exceed this amount resources of CPU usage or of backend processes." And again, we do graceful degradation when that happens. So what I'm showing here is this is a graph of I have a budget set up, um, to say, "Don't exceed these amount of resources, and warn if I do start exceeding these resources." So it's showing me, uh, this is the amount of

[15:23](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=923s) queries that are exceeding your budget over time. And we're, we're, we're sending warnings back to the client like, "Hey, I'm overloaded. You need to slow down." And we can even make it more strict where we actually kill those queries that are executing, right? And this is one of those things that, like, okay, it's not ideal to have to deny requests, but it's much better than your whole application going down and being offline for all of your users. Uh, and then finally, one other thing I w- I wanna talk about, and I know I'm showing this is the PlanetScale UI here, but this is not

[15:52](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=952s) even so much specifically about PlanetScale, but it's about the philosophy of how we do these things with agents, which is most developers are used to using a Git-like flow when you're building, and this applies to your agents as well, right? You have a main, you create a branch, you make code changes, you do merge that in, and you deploy that dynamically to wherever your application is deployed. What we have done, and this was long before agents even existed, is we wanted to take that same UX and mirror that for your database. 'Cause a lot of the times when you're building new

[16:22](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=982s) application features, you're also making changes to your schema. You're adding tables, you're adding columns, you're deleting things, you're, you're adding indexes, you're doing all of this stuff to your database to keep it in sync with your code base. So what we give you, powered by that same Vitess earlier, is the ability to branch your database schema, make changes to that schema in an isolated environment, and then merge that back into production with what we call a deploy request, all with no downtime. And not only that, but actually the ability you might see here at the bottom, the ability to, if you

[16:52](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=1012s) deploy a schema change and you see a problem, we give you the ability to one-click revert that and go back to the old state of your database without data loss. Uh, and so this is something that was great for humans, but we also have the APIs and the CLIs to be able to let agents automate this. So when they are doing things and automating code and branching and making pull requests and doing code review, there can actually be a mirrored database state that is working in sync with all of those things, right? And that can either be fully automated, it can be

[17:22](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=1042s) semi-automated. Obviously, many of us are working in a human-in-the-loop fashion where humans are still reviewing all of these changes that AI agents are making, which is a good thing. Um, but we have the primitives in place for building these, uh, systems. And there's a number of other things that I didn't get to, to talk about this, but kind of the, the ending point that I wanna make is we're a company, and I know a lot of companies out there like to focus on the developer experience. And when I say developer experience, I don't just mean, like, light and dark mode

[17:52](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=1072s) switches and good keyboard shortcuts and all of this, but I mean the actual experience of, hey, if you're a developer that's responsible for your company's database or responsible for some piece of infrastructure, do we give you the tools that you need to not mess up, to do deploys safely, to make your database faster, to get better performance? Uh, and we've been building these things for years, and it does kinda turn out that when you really focus on that core of the developer experience, what you actually end up with is also very good primitives for AI being able to work with a database

[18:22](https://www.youtube.com/watch?v=uKUA1a0Kdfc&t=1102s) safely and reliably and helping it scale. Uh, and so because we expose a lot of these things through our MCP server, through command line interfaces, obviously there's plenty of debate on which of those is better when working with your AI agents. But because we expose those things to both parties, it's actually a great experience for operating your database and working well with AI agents. So that is all that I have to say. Thank you guys for coming. I'm Ben, and, uh, have a great rest of the conference.
