Engineering Decisions · Senior · Question 8 of 14
A PostgreSQL primary is near its limit: 95% of the load is reads, and writes are modest. Growth is steady, and the team is small. What's the next step?
- 1Add read replicas and a cache for hot reads
- 2Move all of the data to a NoSQL store
- 3Shard the database by customer ID now
Show the answer
Correct answer: Add read replicas and a cache for hot reads
Explanation
With a read-heavy load, replicas and a cache add capacity with little change to the application. Sharding fits a write load or dataset too big for one primary, but it costs cross-shard queries and operations a small team doesn't need yet. A NoSQL store fits data shaped around key access at huge scale, and a migration here would solve nothing the replicas can't.