Database Performance Tuning and Scaling Questions
System-level performance work beyond a single query: configuration and resource tuning, capacity planning, handling large data volumes, and scaling read and write throughput. Covers identifying bottlenecks, growth management, and the vertical-versus-horizontal scaling decision. Tests whether a candidate can keep a database healthy as load grows.
Hard scenario: Your distributed database cluster shows increasing WAL (write-ahead log) shipping and apply lag across replicas during peak traffic, causing stale reads. Describe a remediation plan that considers network bandwidth, IO throughput, replica configuration, and acceptance of read staleness. Include short-term and long-term fixes.
Scenario: After migrating to a cloud-managed data warehouse, you find queries scanning more bytes than before and costs spiked. Explain how to profile and reduce scanned bytes (predicate pushdown, partition pruning, column selection, compression, file formats), and outline a cost-control plan.
Design an approach to automatically detect and remediate data skew in an ongoing streaming ingestion pipeline that writes to sharded storage. Include metrics to detect skew, automated remediation strategies, and safety checks to avoid causing instability while rebalancing.
You are given a SQL query that joins a large fact table (events) with small lookup tables; the query is slow. Describe a step-by-step approach to use EXPLAIN/EXPLAIN ANALYZE to identify whether the database is doing a sequential scan, hash join, or nested loop, and what each indicates about possible remedies.
Define replication lag and read replica in a distributed database. Describe two practical causes of replication lag and one operational approach to mitigate each cause.
Unlock Full Question Bank
Get access to all Database Performance Tuning and Scaling interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.