CHAPTER 16 · Scaling and Infrastructure · 10 / 10
The scaling mindset
Scaling an agent is mostly about statelessness, concurrency, and respecting the slow external bottleneck. Keep servers stateless so you can add them freely; use async I/O so idle streaming connections are cheap; push heavy work to workers behind a queue; keep blobs in object storage and metadata in a well-indexed database; cache and rate-limit toward upstreams; and let real measurements, not speculation, tell you when to add the next piece of infrastructure.