Reliability and scale · senior
Preparing for 10x traffic and changing huge tables
Readiness is measured load tests, pre-scaling and an agreed degradation plan. Schema changes on big tables use expand, backfill in throttled batches, then contract.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- For 10x traffic clarify which flows get it, the shape over time (a spike at midnight or spread out), marketing pushes and partner limits (payment gateways, SMS providers, banks).
- Measure today peak and headroom per service. Load test on a production-like setup with a realistic mix and spikes. Fix the first bottleneck and test again. Do not load test a single API only.
- Database at 4 times in three weeks: caching and replicas for reads, connection pooling, missing indexes and slow queries, moving writes off the request path, a bigger instance. Sharding now is too risky.
- Pre-scale before the start because autoscaling takes minutes and spikes take seconds. Raise cloud quotas, warm caches and the CDN, and tell partners the expected volume.
- Agree the degradation plan with product beforehand: kill switches for recommendations, reviews and personalisation, a waiting room and static fallbacks. Freeze changes a few days before; prepare runbooks, on-call and a war room with dashboards; run a game day.
- Reshape a huge table without downtime. Risks: long locks or a full table rewrite, replication lag, blocked writes. In Postgres adding a nullable column without a default is a quick metadata change; MySQL has online DDL, gh-ost or pt-online-schema-change.
- Expand: add new nullable columns, deploy code that writes both old and new, backfill old rows in batches by primary-key range (a few thousand rows), verify, switch reads behind a flag. Contract: stop writing the old column and drop it in a later release.
- The backfill is throttled by replica lag and load, resumable from a checkpoint, idempotent, and run off-peak. Verify with counts and sample comparison. Keep the old column filled until no old app version reads it.
The red pen
Common traps: mistake → fix
Mistake: We will autoscale
Fix: it is too slow for a spike.
Mistake: One giant UPDATE over every row
Fix: it locks and floods replication.
Mistake: Drop the old column in the same release
Fix: old app versions break and you cannot roll back.
Mistake: Change the architecture a week before the sale
Fix: freeze instead.
Easy to hard
Questions interviewers ask, easy to hard
- How do you prepare for 10x traffic in three weeks?
- What do you switch off first when load is too high?
- How do you add a column and backfill a huge table without downtime?
- How do you throttle a backfill?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.