06 / 25 · Traffic and capacity
Vertical scaling
Vertical scaling gives one machine more CPU, memory, storage or throughput. It can be the simplest improvement, but it has a size ceiling and does not create a second copy for failover.
What you will practise
- Match resources to the bottleneck
- separate resizing from redundancy
- plan rollback
Before you start: CPU, memory and disk waits.
About 4 minutes · offline-generated English female narration · captions included. Diagrams are conceptual; timings are illustrative.
Download MP4CaptionsListen without the video
Download audioChapters and full transcript
Let us understand vertical scaling. A student replaces a tiny desk with a larger desk. More books fit, but there is still one desk. A bigger desk does not solve every problem: a lost key to the room still blocks access. Likewise, extra memory helps a memory bottleneck but may not help a slow external payment call. Vertical scaling gives one machine more CPU, memory, storage or throughput. It can be the simplest improvement, but it has a size ceiling and does not create a second copy for failover.
Follow the normal path. The application is slow. Inspect whether requests wait on CPU, memory, storage, locks or another service before selecting a bigger machine. Give the same database more appropriate resources. This is vertical scaling because the number of independent database copies has not increased. A SeatSpot database may benefit from more memory for its working set before the team considers sharding. First measure the constraint rather than buying a larger machine because the site feels slow.
Now change one condition. More memory can hold more of the hot working set. If disk reads were the bottleneck, the experiment may show lower latency. A common misunderstanding is this: A larger instance is a second failover copy. It remains one instance unless a separate redundancy design exists. Think about this. A payment provider takes five seconds. Will doubling your app RAM necessarily fix it? Pause the video and make your prediction. No. Extra RAM does not shorten an external provider delay. Measure the critical path first.
Let us reason with a concrete example. The database reads a 12 GB hot dataset but has only 4 GB available for useful caching. A larger memory budget may improve hit rate; the actual benefit depends on access patterns, other memory users and query plans. Doubling RAM is not a promise of double throughput. Profile the working set and expensive queries, test a larger instance in a safe environment and measure tail latency and restart behavior. These figures are teaching examples, not production guarantees.
Turn the idea into a design decision. A size change may restart or fail over the database. Use the actual platform procedure and verify what users see during the transition. Repeat the same controlled workload. Compare throughput, tail latency, waits and cost; do not use machine size as the success metric. When you try the practice task, look for this result. A resize is justified by observed improvement and operational constraints, not instance size alone.
Check your understanding. The larger machine still needs redundancy and backups. If the machine fails or reaches its size ceiling, a different design decision is needed. Here is a challenge. CPU is idle but one SQL query waits on a lock. Will twice as many cores fix it? Pause before the answer. Probably not. Inspect the blocking transaction, query and locking strategy. Extra cores do not release the lock. Re-test after addressing the measured contention. For an interview, choose a resource using profiling and compare cost. Say what you would measure, not only which tool you would buy.
Start with an everyday picture
A student replaces a tiny desk with a larger desk. More books fit, but there is still one desk. A bigger desk does not solve every problem: a lost key to the room still blocks access. Likewise, extra memory helps a memory bottleneck but may not help a slow external payment call.
Why SeatSpot needs this
A SeatSpot database may benefit from more memory for its working set before the team considers sharding. First measure the constraint rather than buying a larger machine because the site feels slow.
Trace one step at a time
Move through the diagram at your pace. Teal paths are active; unavailable components are labelled.
Measure the wait
The application is slow. Inspect whether requests wait on CPU, memory, storage, locks or another service before selecting a bigger machine.
Read all six mechanism steps
Measure the wait
The application is slow. Inspect whether requests wait on CPU, memory, storage, locks or another service before selecting a bigger machine.
Increase resources
Give the same database more appropriate resources. This is vertical scaling because the number of independent database copies has not increased.
Watch useful memory
More memory can hold more of the hot working set. If disk reads were the bottleneck, the experiment may show lower latency.
Plan interruption
A size change may restart or fail over the database. Use the actual platform procedure and verify what users see during the transition.
Retest the result
Repeat the same controlled workload. Compare throughput, tail latency, waits and cost; do not use machine size as the success metric.
Keep a recovery plan
The larger machine still needs redundancy and backups. If the machine fails or reaches its size ceiling, a different design decision is needed.
Pause and make a prediction
A payment provider takes five seconds. Will doubling your app RAM necessarily fix it?
Correct a common misunderstanding
Claim to question: A larger instance is a second failover copy.
Better explanation: It remains one instance unless a separate redundancy design exists.
Write a resize experiment
- Record latency, memory pressure, CPU and I/O waits.
- Choose one resource change in a test environment.
- Repeat the same workload and measure restart/recovery behavior.
Check what you can explain
This is your self-check, not an automated grade. Try again without the diagram tomorrow.
0 of 3 goals checked. Choose one remaining idea to practise next.
Teach it back
Without looking, explain what this component changes, what it does not solve and what happens if it fails. Use the animation to check your explanation, then switch to Engineering.
Engineering model and trade-offs
Inspect CPU, memory pressure, disk latency and database waits. More RAM may reduce reads from disk; more cores do not remove a serial lock or an external network delay.
An instance-size change can require a restart or failover, depending on the platform. Test supported upgrade paths, rollback and storage compatibility. Never promise downtime-free resizing without verifying the actual service.
Compare total cost and operational effort. Vertical scaling can buy time for a small team; it is not automatically a bad design. Maintain backups and redundancy independently.
Work through an example
The database reads a 12 GB hot dataset but has only 4 GB available for useful caching.
Reason with the numbers
A larger memory budget may improve hit rate; the actual benefit depends on access patterns, other memory users and query plans. Doubling RAM is not a promise of double throughput.
Make a decision
Profile the working set and expensive queries, test a larger instance in a safe environment and measure tail latency and restart behavior.
Implementation sketch
Measure -> resize in test -> repeat load test
Compare: p95/p99 latency, throughput, memory, I/O waits
Verify: restart/failover time and rollback planThis is an operational experiment, not a browser-executable command or a recommendation for a particular paid machine.
Where this is used
- Memory-bound databases or applications.
- A measured short-term capacity increase with a manageable upgrade path.
Common mistakes
- Calling a larger machine highly available.
- Resizing without checking restart behavior.
- Ignoring an inefficient query that needs indexing.
Practise a reasoned answer
Answer aloud or write notes before opening the reference. These prompts teach reasoning and trade-offs; they are not claimed questions from a particular company.
Why choose vertical before horizontal scaling?
Choose a practice depth
- Foundation
- Explain making one machine larger.
- Practical
- Choose a resource using profiling and compare cost.
- Advanced
- Discuss size ceilings, migration/restart behavior, rollback and alternative query improvements.
Self-check rubric
- State the required user outcome and the relevant invariant.
- Explain the normal path and one failure path.
- Name a cost or consistency/latency trade-off.
- Say what you would measure or test before trusting it.
For deeper practice, connect this topic to the previous lesson and identify a shared bottleneck. A longer answer is not automatically a better answer.
Try it before viewing the solution
CPU is idle but one SQL query waits on a lock. Will twice as many cores fix it?
Check one key idea
Your explanation and interview notes
Saved only in this browser when storage is available. Export a backup from the course page before clearing browser data or moving devices.
Loading your local notes…
Official references and next reading
The explanation, fictional examples and animations are original teaching material. Vendor behavior depends on the specific product/version; use its documentation before deploying.