中文
Cursor Compile

Letting agents loose on a 600TB production database doesn't run on trust — it runs on infrastructure primitives.

Agents and Infrastructure, Sam Lambert | Compile 26 · Sam Lambert

26 min
AgentAI ProductContextAI Coding

26 min total·Actually worth watching closely: ~6 min·2 must-watch clips

Orange = the 6 minutes worth watchingFor the rest, the guide is enough
Segment guide · 7 segments
  1. 0:00 2:22Listen

    Opening: the role of infrastructure has changed

    Sam Lambert sets out the platform's new job in the agent era: distill complex backend state into instruction an agent can act on directly, and package decades of database expertise into primitives.

    For the first time the platform can write code for its customers — expertise turned into prompts and primitives and handed to agents

    Pure spoken argument with no key visuals — fine to just listen▶ Jump to 0:00
    Speaker · Sam Lambert
  2. 2:22 7:04Watch

    Live demo: agents swarm the slow queries

    Queries on the demo site average nearly four seconds and people abandon their checkouts; one master agent dispatches sub-agents in parallel to work through index and query optimizations stage by stage.

    Insights generates recommendations with full context, and the agent can act on them autonomously the moment it has them — the traditional DBA job, automated

    This chapter really is visual: the live view of the agent pipeline at each stage (around 2:22 and 4:40) is the part most worth watching on screen▶ Jump to 2:22
    Speaker · Sam Lambert
  3. 7:04 11:24Listen

    Guardrails and instant rollback

    Planetscale checks every deploy request for whether it would break in-flight queries and refuses by default, catching the agent's drop column; the schema can be flipped back to the previous version in an instant without losing any writes in between.

    Platform mechanisms replace trust in the agent: being able to undo — a revert whose cost doesn't scale with size — is what makes letting go possible

    Mostly a spoken account of the block and the rollback; no strong visual dependency▶ Jump to 7:04
    Speaker · Sam Lambert
  4. 11:24 14:04Skim

    Why sharding becomes unavoidable

    The optimizations bring more load and vertical scaling runs out; the talk explains how sharding breaks a single data set across multiple fully encapsulated clusters spread over availability zones while the application still thinks it's connecting to one database.

    Sharding buys far more resilience: losing a primary or replicas only loses a subset of the data, and the complexity stays hidden behind one connection

    The architecture explanation around 12:43 comes with slides — a glance at the topology diagram is enough, no need to watch second by second▶ Jump to 11:24
    Speaker · Sam Lambert
  5. 14:04 16:48Listen

    Sharding in one sentence: declarative primitives

    The speaker who once wrote a GitHub issue telling people to put sharding off now just says "shard this database" to an agent; a V schema declaratively defines the sharded keyspace, and Vindexes the hash and the sharding key.

    The one decision still left to humans: getting the right natural sharding key from an understanding of the product. Everything else goes to the agent

    Mostly concepts and interface design — following the configuration details loosely is enough▶ Jump to 14:04
    Speaker · Sam Lambert
  6. 16:48 21:07Listen

    The massive refactor: killing scatter-gather

    A query without the sharding key fans out to every shard and materializes the results back; Cursor goes through a 10-year-old app adding the sharding key to every query and reworking every call path, with zero impact on the live site throughout the sharding.

    Humans pick the sharding key, agents do the large mechanical refactor humans least want to do — the cleanest template yet for the human/agent split

    The refactor is mostly narrated; the order-volume spike at 19:57 that closes it is already listed separately as a must-watch▶ Jump to 16:48
    Speaker · Sam Lambert
  7. 21:07 25:35Listen

    Wrap-up: design patterns for agents

    Pulls the talk's patterns together: safe by default, instantly undoable, platform arbitration and back pressure as constraints, and reducing the amount of power an agent needs — plus the note that this system was originally built for the most non-deterministic agent of all, humans.

    Even if models stop getting better, the real opportunity is the infrastructure that carries production systems through decades of evolution — if we can do it with databases, we can do it with anything

    Pure closing argument, dense with quotable lines — worth listening to all the way through▶ Jump to 21:07
    Speaker · Sam Lambert