Interview › Databases & Caching
How do you scale reads versus writes on a relational database?
Databases & Caching · Basic level
Answer
Reads can be scaled with replicas, caching, materialized views, query optimization, denormalized read models, and analytics offload. Writes are harder because consistency and uniqueness usually concentrate around one writer, so write scaling may require partitioning, sharding, queues, batching, or architecture changes.
Technical explanation
Read scaling is safe only when stale reads are acceptable or read-after-write paths use the primary.
Write scaling is constrained by transactions, constraints, referential integrity, and cross-shard behavior.
Most teams should tune queries and cache reads before redesigning writes.
Hands-on example
Example split:
POST /orders -> primary RDS writer
GET /products -> Redis/Valkey cache
GET /reports -> read replica or warehouse
Heavy post-processing -> queue and workerThis keeps OLTP writes short and moves expensive reads away from the writer.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Databases & Caching interview questions
- How do you scale an RDS database vertically and what is the downtime impact?
- What is connection pooling, and why does it matter for RDS (e.g., RDS Proxy)?
- What are common causes of high RDS CPU, and how do you investigate?
- What is RDS Proxy, and what problem does it solve?
- What is Performance Insights, and what does it help you find?
- How do you monitor RDS performance (CloudWatch, Performance Insights, Enhanced Monitoring)?
- What is MVCC, and how does PostgreSQL implement it?
- What is VACUUM in PostgreSQL, and why is autovacuum important?