Before you reach for a read replica, reach for an index and EXPLAIN. The boring fixes are usually the big ones.
Most “we need to scale the database” conversations end the moment someone actually runs EXPLAIN ANALYZE. The slow query is doing a sequential scan over a table that should have been indexed months ago.
EXPLAIN ANALYZE
SELECT * FROM entries
WHERE account_id = $1
ORDER BY created_at DESC;
- Index the filter and the sort. A composite index often replaces a replica.
- Watch for N+1 before you blame the engine.
- Measure, then change one thing. Tuning by vibes makes things worse.
Replicas, partitioning, and connection pools are real tools — for real problems, reached for last. Most teams are three indexes away from fine.