Readyset Weekly: Issue 26
Round-Robin Load Balancing, the Right Way
Round-robin load balancing is the simplest way to spread reads across database replicas. It's often the first scaling step for teams moving past a single node, but simplicity doesn't mean "set and forget." Done right, it evens out load. Done wrong, it hides lag, stale reads, and uneven performance.
Here's how to make it work:
- Use a proxy, not the app layer: Set up a lightweight proxy like HAProxy, pgbouncer, or Nginx Stream to handle rotation. Each new connection is assigned to the next replica in sequence, no application rewrites required.
- Watch replica lag: Round-robin doesn't know when a replica is stale. In Postgres, use
pg_stat_replication; in MySQL, usept-heartbeat. Keep replication delay under ~100 ms for OLTP workloads or you risk returning outdated results. - Match pooling to workload: Use transaction pooling for short web requests and session pooling for analytics or background jobs. Mixing both can overload certain replicas while others sit idle.
- Automate health checks: Enable SQL-based checks so lagging or failed replicas drop from rotation automatically (for Postgres, replace the first line with
option pgsql-check user haproxy_check):
option mysql-check user haproxy_check
inter 2s fall 3 rise 2
Round-robin is perfect for read-heavy systems with consistent query costs. But it's blind to CPU load, latency, and query complexity. As scale grows, teams layer in latency-aware or adaptive routing for better balance.
At Readyset, we see round-robin as step one on the scaling path; distribute work first, then eliminate it. QueryPilot takes that next step by caching repetitive queries at the SQL layer, reducing the load before it even hits your proxy.
🔍 What We're Watching in the Database Ecosystem
Technological Optimism and Appropriate Fear
Jack Clark draws a useful parallel for anyone building at scale. Progress in AI, like Sonnet 4.5's leaps, shows how fast systems evolve when optimization compounds. But as complexity scales, so do blind spots. His takeaway applies beyond AI: ambition is essential, but scaling well requires visibility, control, and intent.
Inside the MySQL Architecture That Powers YouTube's Billions of Daily Queries
This post breaks down how YouTube scales MySQL to serve billions of daily queries using replication, sharding, caching, and custom routing. It's a great example of what it takes to scale the traditional way, with heavy engineering effort, constant tuning, and custom logic baked into the data path.
Call Me A Jerk: Persuading AI to Comply with Objectionable Requests
This piece shows that large language models respond to persuasion much like people do. Techniques like authority, commitment, and unity more than doubled compliance rates, revealing that how we ask matters as much as what we ask. It's a reminder that intelligent systems mirror human patterns more closely than we expect.
In Case You Missed It
How Readyset Handles Window Functions Under the Hood
Readyset now supports standard SQL Window Functions for MySQL and PostgreSQL, integrating them directly into its streaming dataflow engine. The system keeps incremental caches efficient by distinguishing between cumulative and non-cumulative execution, recomputing only what's necessary when new records arrive. By processing partitions instead of full windows, Readyset reduces data movement while maintaining real-time accuracy.
Get Readyset Weekly in your inbox
One email a week — what shipped, what we learned, and what is worth reading.